lundi 26 février 2018

How to filter Laravel Datatable lists with external variable

I want to pass a new field lender_id when it calls datatable model from view file.

      $tableBuilder = $tableBuilder->columns([
        ['data' => 'id' , 'name' => 'id' , 'title' => 'Id'] ,
        ['data' => 'name' , 'name' => 'name' , 'title' => 'Name'])
    ->parameters([
        'dom'          => 'Blfrtip' ,
        'with'          =>'lender_id=2',//i tried

            });
        }" ,
    ])/*->render($url) Tried this also*/;

Right now the URL generate from view is

http://investment2.demo/admin/merchants/data?draw=2&columns%5B0%5D%5Bdata%5D=id&columns%5B0%5D%5Bname%5D=id&columns

I want it to be

http://investment2.demo/admin/merchants/data?draw=2&columns%5B0%5D%5Bdata%5D=id&columns%5B0%5D%5Bname%5D=id&columns&lender_id=2



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire