bind('messenger_user', function ($id) { $messenger_user = $this->app->make('\Guru\MessengerUser\Interfaces\MessengerUserRepositoryInterface'); return $messenger_user->findorNew($id); }); }if (Request::is('*/messenger_user/messenger_message/*')) { $router->bind('messenger_message', function ($id) { $messenger_message = $this->app->make('\Guru\MessengerUser\Interfaces\MessengerMessageRepositoryInterface'); return $messenger_message->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'; }); } }