routes.php
Route::post('admin/cm/{adres_id}/create', 'PugController@newEntrieAdd')->before('guest');
Route::get('admin/cm/{adres_id}/new', 'PugController@newEntrie')->before('guest');
PugController
public function newEntrieAdd($adres_id){
$mytime = date('Y-m-d');
$scannedTime = date('Y-m-d H:i:s');
DB::table('adres_gescand')
->where('adres_id', $adres_id)
->where('tijdstip', '>=' , $mytime)
->update(['actief' => 1, 'tijdstip' => $scannedTime]);
return redirect('admin/lijstbeheeracv');
}
// einde cm
// cm
public function newEntrie($adres_id){
$entries = DB::table('adres_all')->get();
return view('cm.bruggepost1', compact('entries'));
}
snippet of cm.bruggepost1
<form action="/cm/public/index.php/admin/cm/$adres_id/create" method="post" class="form-horizontal form-bordered">
What I want to do is when i go to /admin/cm/5/new I want to click on a button. And that will reffer to the snippet of cm.bruggepost1. But the problem is I can't find any way to use the variable (5 in here) in the cm.bruggepost. That $adres_id can be any number.
I hope someone can help me with explaining what I can do.