/** * Define your route model bindings, pattern filters, etc. * * @param \Illuminate\Routing\Router $router * @return void */ public function boot(Router $router) { // parent::boot($router); $router->bind('trashed_articles', function ($id) { return \Pipeline\Article::withTrashed()->findOrFail($id); }); $router->model('articles', 'Pipeline\\Article'); }
public function update(Article $article, ArticleRequest $request) { //$article = Article::findOrFail($id); $article->update($request->all()); return redirect('articles'); }