| |

PHP Advanced Datatable in Laravel >= 5.0


in the action of your controller put the following code:
    $dt = new Your/Datatable/Class(
            array(
                'firstname' => 'Firstname',
                'lastname' => 'Lastname'
            ),
            //Columns whose use custom render
            array(
                    'column _name'=>'static function pesent in datatable class'
                    'firstname'=>'function_name_for_firstname_field'
                )
    );
    return $dt->display('Your/Blade/Template',$request);

in the your datatable put the following code:

    static function function_name_for_firstname_field($r)
    {
        return  <a href=""> $r->firstname </a> ;
    }



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

Note:

Any column is used in creating datatable object as shown above must be present in the query builder.


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