| |

PHP Advanced Datatable in Laravel >= 5.0


IDUsernameFirstnameLastnameEmail



You can add a text filter by call "addfilter(filed_name,'text',label,operator)" from datatable object that was created in the action of your controller as shown below:


    $dt->addfilter(filed_name,'text',label,operator);

    operator takes the following values:    =
                                            <
                                            >
                                            >=
                                            <=
                                            !=
                                            like

For example:
in the action of your controller put the following code:

    $dt = new Your/Datatable/Class(
            array(
                'firstname' => 'Firstname',
                'lastname' => 'Lastname'
            ));
    $dt->addfilter('username','text','Username','like');
    return $dt->display('Your/Blade/Template',$request);


in your blade template where you want your datatable appears put the following code:
	@include('phpdt::datatable_view')
	@section('datatable_section')
		@parent
	@show
        
Note:

filed_name passed in "addfilter" must be declared in the select statement of your datatable class.


By: Mohammad Alaa Aldeen
Git: https://github.com/mhdalaaaldeen