app->make('Litepie\Blog\Interfaces\BlogRepositoryInterface'); return $blogrepo->findorNew($blog); }); } if (Request::is('*/blog/category/*')) { Route::bind('category', function ($category) { $categoryrepo = $this->app->make('Litepie\Blog\Interfaces\CategoryRepositoryInterface'); return $categoryrepo->findorNew($category); }); } if (Request::is('*/blog/tag/*')) { Route::bind('tag', function ($tag) { $tagrepo = $this->app->make('Litepie\Blog\Interfaces\TagRepositoryInterface'); return $tagrepo->findorNew($tag); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); } /** * Define the "web" routes for the package. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } }