vendredi 20 novembre 2015

Laravel Missing argument 1 for controller method

I'm getting the following error after a composer update:

Missing argument 1 for Modules\Documentation\Http\Controllers\Frontend\DocumentationController::show()

The route looks like this:

$router->get('docs/{page}', ['as' => 'doc.show', 'uses' => 'Frontend\DocumentationController@show'])->where('page', '.*');

With controller method:

public function show($page)
{
    try {
        $title = $this->documentation->getTitle($page);
    } catch (FileNotFoundException $e) {
        App::abort('404');
    }

    $subtitle = $this->documentation->getSubTitle($page);
    $content = $this->documentation->getContent($page);

    return view('doc.index', compact('content', 'title', 'subtitle'));
}

This is an example of (working) same code before composer update: http://ift.tt/1D5GSHy

I've tried removing the ->where() method on the route, making parameter optional, nothing changes.

Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire