php - Laravel Chumper Datatable getting data into one datatable from multiple MySQL tables -



php - Laravel Chumper Datatable getting data into one datatable from multiple MySQL tables -

i trying create datatable, contains info more 1 mysql table.

i using chumper using laravel, far can see there no examples using more 1 sql table @ 1 time.

here code:

<?php class crudcontroller extends basecontroller { public function instances(){ $query = ec2instance::select('instance_id', 'public_dns_name', 'key_name', 'instance_type', 'launch_time' )->get(); $c_num= account::select('aws_account_id' )->get(); $t_name= tag::select('value' )->get(); homecoming datatable::collection($query, $c_num, $t_name) ->addcolumn('instance_id', function($model){ homecoming $model->instance_id ; }) ->addcolumn('public_dns_name', function($model){ homecoming $model->public_dns_name; }) ->addcolumn('key_name', function($model){ homecoming $model->key_name; }) ->addcolumn('instance_type', function($model){ homecoming $model->instance_type; }) ->addcolumn('launch_time', function($model){ homecoming date('m j, y h:i a', strtotime($model->launch_time)); }) ->addcolumn('aws_account_id', function($model){ homecoming $model->aws_account_id; }) ->addcolumn('value', function($model){ homecoming $model->value; }) ->searchcolumns('instance_id', 'public_dns_name', 'key_name', 'instance_type', 'launch_time', 'aws_account_id', 'value' ) ->ordercolumns('instance_id', 'instance_type', 'public_dns_name', 'key_name', 'launch_time', 'aws_account_id', 'value' ) ->make(); } }

the $query values fine , render correctly $c_num , $t_name missing.

php mysql laravel datatable

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -