jeudi 26 juillet 2018

Laravel cannot find a Controller Method (does not exist)

I'm trying to implement a new method in a BoController called "deleteBooking", the method is defined:

public function deleteBooking($id){
    $booking = Reservation::find($id);
    if($booking && $booking->delete()){
        try {
            $email = Mail::to($booking->user_email)->send(new Cancel($booking));
        } catch(\Exception $e){
            Log::error($e->getMessage());
        }

        return redirect('admin/manager/home')->with('message','Réservation annulée!');
    }
    return redirect('admin/manager/home')->with('message','Réservation non annulée!');
}

But laravel at the endpoint says:

(1/1) BadMethodCallException
Method [deleteBooking] does not exist.

Other methods from the same class are linked to endpoints too, and work well.

Do you have any ideas please? Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire