I have this route in my developer group in web.php
Route::get('{store}/products/{products}/variants', [
'as' => 'variants.create',
'uses' => 'VariantsController@create',
]);
Route::post('{store}/products/{products}/variants', [
'as' => 'variants.store',
'uses' => 'VariantsController@store',
]);
in which the {store} is a slug, and {products} is the uuid.
now my VariantsController@create:
public function create($store, $id)
{
$store = Store::where('slug', $store)->firstOrFail();
$product = $store->products()->findOrFail($id);
return view('devoptions.products.variants', compact('store'));
}
and my variants.blade.php
<div class="container">
<div class="row">
{!! Form::open([ 'route' => ['developer.variants.store', $store->slug],
'method' => 'POST' ]) !!}
<div class="col-sm-12">
<div class="page-header">
//more code here
and I am getting the error:
Missing required parameters for [Route: developer.variants.store] [URI: developer/{store}/products/{products}/variants]. (View: /Users/Kit/nowna-core-php-api/resources/views/devoptions/products/variants.blade.php)
I have tried passing the $product but I do not know how, even if I try to, it does not work. please help.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2BVSJO6
via IFTTT
Aucun commentaire:
Enregistrer un commentaire