Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bhhussain's avatar

Missing required parameters for Route

I am getting the below error when I try to edit.

Facade\Ignition\Exceptions\ViewException
Missing required parameters for [Route: foh.pending.update] [URI: foh/pending/{pending}]. (View: C:\laragon\www\jarwani\resources\views\foh\pending\edit.blade.php)

Route:

Route::resource('/foh/pending', 'Foh\PendingController', ['as'=>'foh']);

Controller

 public function edit(Booking $booking)
    {      

        $arr['booking'] = $booking;
        return view('foh.pending.edit')->with($arr);
    }
public function update(Request $request, Booking $booking)
    {
        $booking->tb_cust_name = $request->tb_cust_name;        
        $booking->tb_cust_addr = $request->tb_cust_addr;       
        $booking->tb_cust_contact = $request->tb_cust_contact;
        $booking->tb_cust_mobile = $request->tb_cust_mobile;
        $booking->tb_cust_email = $request->tb_cust_email;




        
      
        

     
            
               
        $tdate  = Carbon::now();
        $booking->tb_appr_date = $tdate; 

        $booking->save();
        return redirect()->route('foh.pending.index')->with('info','Transaction updated successfully!');
    }

Can any one please help me to find the reason for this error.

Thank you

0 likes
3 replies
fylzero's avatar

@bhhussain It is basically saying you are missing the id param for pending in the URI.

I don't think you should be using a name on a resource route either. I would remove that. That could just be me though.

Route::resource('/foh/pending', 'Foh\PendingController');
24 likes
bhhussain's avatar

@fylzero Thanks for your reply.

The below code is giving some other error. I have around 15 model and controller.

I am always having the same problem when I use the one model for two different controller. I know that will not be the problem but I dont know why.

Route::resource('/foh/pending', 'Foh\PendingController');

Route List Full

Route::resource('/foh/booking', 'Foh\BookingController', ['as'=>'foh'])->middleware('auth');
Route::resource('/foh/bookinghistory', 'Foh\BookinghistoryController', ['as'=>'foh']);
Route::resource('/foh/addon', 'Foh\AddonController', ['as'=>'foh']);
Route::resource('/foh/pending', 'Foh\PendingController', ['as'=>'foh']);

Any other option to resolve?

Thank you

fylzero's avatar

@bhhussain You need to get rid of all those aliases/named routes. This will not work. Also the slashes in from of your routes are not needed.

Rewrite like this...

Route::resource('foh/booking', 'Foh\BookingController')->middleware('auth');
Route::resource('foh/bookinghistory', 'Foh\BookinghistoryController');
Route::resource('foh/addon', 'Foh\AddonController');
Route::resource('foh/pending', 'Foh\PendingController');
23 likes

Please or to participate in this conversation.