Reputation:
What is this error?
Use of undefined constant id - assumed 'id'
public function update(Request $request)
{
SubmitApplication::where('id', $request->get(id))->update(['approved' => true]);
return redirect()->back();
}
Upvotes: -1
Views: 2071
Reputation: 40919
Strings need to be wrapped in quotes, otherwise PHP assumes it's a name of a constant, hence the error.
Replace
$request->get(id)
with
$request->get('id')
Upvotes: 1