app->make('Newage\Votes\Interfaces\VoteItemRepositoryInterface'); return $vote_itemrepo->findorNew($vote_item); }); } if (Request::is('*/votes/vote_topic/*')) { Route::bind('vote_topic', function ($vote_topic) { $vote_topicrepo = $this->app->make('Newage\Votes\Interfaces\VoteTopicRepositoryInterface'); return $vote_topicrepo->findorNew($vote_topic); }); } if (Request::is('*/votes/vote_voter/*')) { Route::bind('vote_voter', function ($vote_voter) { $vote_voterrepo = $this->app->make('Newage\Votes\Interfaces\VoteVoterRepositoryInterface'); return $vote_voterrepo->findorNew($vote_voter); }); } } /** * 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() { if (request()->segment(1) == 'api' || request()->segment(2) == 'api') { return; } Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, 'prefix' => trans_setlocale(), ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } }