Monday, May 22, 2017

multiple select query in same laravel view

I got a problem when I want to show my data in view from same table, but I just need one of field in that table.. through controller, there were function index() and setID()

this is my controller

public function index(){
    $wo = DB::select('select max(nowo)+1 as nowo, CURRENT_DATE as tgl from workorder');
    return view('entri_wo')->with(['workorder'=>$wo]);
}

public function setID()
{
    $wo = DB::select('select idmontir from workorder');
    return view('entri_wo',['wo'=>$wo]);
}

this is my view entri_workorder

Also, i want to show this entri_workorder

And this is my route

Route::get('/entri_wo', 'WoController@index')->name('entri_wo');

Please help me, thank you



via Melvin J'Co

Advertisement