How to fix laravel "Undefined index: id" error laravel "Undefined index: id" ? Occurs when trying to delete a page in the admin panel.

 if($request->isMethod('delete')) { $page->delete(); return redirect('admin')->with('status','Страница удалена'); } if($request->isMethod('post')) { $input = $request->except('_token'); $validator = Validator::make($input,[ 'name'=>'required|max:255', 'alias' => 'required|max:255|unique:pages,alias,'.$input['id'], 'text' => 'required' ]); } 
  • Laravel something to do with it? you simply have no such value in the associative array, because, obviously, you do not pass it to input - etki
  • 1) It’s just outrageous that you can’t break into 2 routes? why push everything into one 2) You wrote yesterday, you don’t have Request id, that’s why the input array doesn’t contain id, do dd($input) before $ validator - Orange_shadow

0