bind('calendars', function ($id) { $calendars = $this->app->make('\Emixion\Calendar\Interfaces\CalendarsRepositoryInterface'); return $calendars->findorNew($id); }); }if (Request::is('*/calendar/events/*')) { $router->bind('events', function ($id) { $events = $this->app->make('\Emixion\Calendar\Interfaces\EventsRepositoryInterface'); return $events->findorNew($id); }); } } /** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * * @return void */ public function map(Router $router) { $router->group(['namespace' => $this->namespace], function ($router) { require __DIR__ . '/../Http/routes.php'; }); } }