app->make('Litepie\Plan\Interfaces\PlanRepositoryInterface'); return $planRepo->findorNew($plan); }); } if (Request::is('*/plan/plan_feature/*')) { Route::bind('plan_feature', function ($plan_feature) { $plan_featureRepo = $this->app->make('Litepie\Plan\Interfaces\PlanFeatureRepositoryInterface'); return $plan_featureRepo->findorNew($plan_feature); }); } if (Request::is('*/plan/plan_subscription_usage/*')) { Route::bind('plan_subscription_usage', function ($plan_subscription_usage) { $plan_subscription_usageRepo = $this->app->make('Litepie\Plan\Interfaces\PlanSubscriptionUsageRepositoryInterface'); return $plan_subscription_usageRepo->findorNew($plan_subscription_usage); }); } if (Request::is('*/plan/plan_subscription/*')) { Route::bind('plan_subscription', function ($plan_subscription) { $plan_subscriptionRepo = $this->app->make('Litepie\Plan\Interfaces\PlanSubscriptionRepositoryInterface'); return $plan_subscriptionRepo->findorNew($plan_subscription); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); $this->mapApiRoutes(); } /** * 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'); }); } /** * Define the "api" routes for the package. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => 'api', ], function ($router) { require (__DIR__ . '/../../routes/api.php'); }); } }