app->make('Annie\Campaign\Interfaces\CampaignRepositoryInterface'); return $campaignrepo->findorNew($campaign); }); } if (Request::is('*/campaign/campaign_kind_support/*')) { Route::bind('campaign_kind_support', function ($campaign_kind_support) { $campaign_kind_supportrepo = $this->app->make('Annie\Campaign\Interfaces\CampaignKindSupportRepositoryInterface'); return $campaign_kind_supportrepo->findorNew($campaign_kind_support); }); } if (Request::is('*/campaign/campaign_volunteer/*')) { Route::bind('campaign_volunteer', function ($campaign_volunteer) { $campaign_volunteerrepo = $this->app->make('Annie\Campaign\Interfaces\CampaignVolunteerRepositoryInterface'); return $campaign_volunteerrepo->findorNew($campaign_volunteer); }); } } /** * 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'); }); } }