[Vuejs]-Unknown Laravel Exception

3👍

As you are using put method in fact you are hitting:

public function update(Request $request, Page $page)
{
    //
}

controller method. Because you have here Page $page as argument, Laravel using route model binding automatically run:

Page::findOrFail($page);

and because you set in Vue url as /admin/resource/pages/store in fact it will run:

Page::findOrFail('store');

Of course I assume you don’t have any page record with id = ‘store’ so that’s the reason why you are getting this error.

So probably you should correct your route in Vue, to pass valid id instead of store or use other method for example POST with valid route.

In console you can run:

php artisan route:list

to see all available routes.

Leave a comment