mardi 28 août 2018

Laravel Undefined variable: store error but my store is defined

I am trying to pass multiple parameters from my blade.php

{!! Form::open([ 'route' => ['developer.variants.store', $store->slug, $product->uuid], 
'method' => 'POST' ]) !!}

and it gives me the error:

Undefined variable: store (View:/directory/products/variants.blade.php)

This is my Create in my controller:

    public function create($store, $id)
{
    $store = Store::where('slug', $store)->firstOrFail();
    $products = $store->products()->findOrFail($id);
    return view('devoptions.products.variants', compact('store, products'));
}

what should I do? what is the correct way of passing multiple parameters?



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

Aucun commentaire:

Enregistrer un commentaire