dimanche 18 décembre 2016

Laravel 5 pginate with orderby

I am new in laravel.

How to order column within specific page.

For e.g, Suppose i open second page in this page i get five records but when i order some column display other page record.

Model:

class customerMaster extends Model { protected $table = 'co_customer_master'; public $fillable = ['customer_id','customer_name','customer_mobile','customer_email','customer_address','payment_range','settopbox_number'];

}

Controller:

public function customerFunctionGet(Request $request) { $main_array['list_datas'] = customerMaster::orderBy($order,$orderBy)->paginate(2); return view('customerMaster',['main_array'=>$main_array]); }

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire