mercredi 16 octobre 2019

Route not found laravel

I'm getting an error 404|Not found , while the route is existing and the debugger is on I have cleared route cachebut still showing the error, when I php artisan route:list it shows POST | products/{product}/favourites | product.fav.store | App\Http\Controllers\HomeController@store How can I solve this?

controller

public function store(Request $request, Product $product)
{
    $request->user()->favouriteProducts()->syncWithoutDetaching([$product->id]);

    return back();
}

Blade

<span class="pull-right">
<a href="" onclick="event.preventDefault(); document.getElementById('product-fav-form').submit();">Add to Fav</a>

<form id="product-fav-form" class="hidden" action="   " method="POST">

</form>
</span>

Route

 Route::post('/products/{product}/favourites', 'HomeController@store')->name('product.fav.store');


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35Dn2nf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire