/** * Map routes. * * @param \Illuminate\Contracts\Routing\Registrar $router */ public function map(Registrar $router) { $this->group(['prefix' => 'tags', 'as' => 'tags.'], function () { $this->get('/', ['as' => 'index', 'uses' => 'TagsController@index']); $this->get('trash', ['as' => 'trash', 'uses' => 'TagsController@trash']); $this->get('create', ['as' => 'create', 'uses' => 'TagsController@create']); $this->post('store', ['as' => 'store', 'uses' => 'TagsController@store']); $this->group(['prefix' => '{blog_tag_id}'], function () { $this->get('/', ['as' => 'show', 'uses' => 'TagsController@show']); $this->get('edit', ['as' => 'edit', 'uses' => 'TagsController@edit']); $this->put('update', ['as' => 'update', 'uses' => 'TagsController@update']); $this->put('restore', ['as' => 'restore', 'uses' => 'TagsController@restore']); $this->delete('delete', ['as' => 'delete', 'uses' => 'TagsController@delete']); }); }); $this->bind('blog_tag_id', function ($id) { return Tag::withTrashed()->findOrFail($id); }); }