jeudi 29 septembre 2016

Laravel parameters without explicitly specifying

I want to generate the page url without $name, something like this

http://ift.tt/2dI6Idh

BUT with the route get('/action/{name}', ...) i can get only this

http://ift.tt/2deDi3Jsomename

If i changing route to Route::get('/action', ...) it doesnt work, the error is "Missing argument 1"

My web.php

Route::get('/action/{name}', [
   'uses' => 'DoActionController@getAction',
   'as' => 'returnAction',
]);

My Controller action

public function ($name)
{
    return view('returnaction', ['name'=>$name]);
}

My home page

<body>
@foreach ($yourActions as $yourAction)
    <li> 
        <a href="">  </a> 
    </li>
@endforeach 



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

Aucun commentaire:

Enregistrer un commentaire