registerBindings(); } /** * Register model bindings. * * @return void */ protected function registerBindings() { $this->app->router->model('component', 'CachetHQ\Cachet\Models\Component'); $this->app->router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup'); $this->app->router->model('incident', 'CachetHQ\Cachet\Models\Incident'); $this->app->router->model('incident_template', 'CachetHQ\Cachet\Models\IncidentTemplate'); $this->app->router->model('metric', 'CachetHQ\Cachet\Models\Metric'); $this->app->router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint'); $this->app->router->model('setting', 'CachetHQ\Cachet\Models\Setting'); $this->app->router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber'); $this->app->router->model('subscription', 'CachetHQ\Cachet\Models\Subscription'); $this->app->router->model('user', 'CachetHQ\Cachet\Models\User'); } /** * 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 $router) { $path = app_path('Http/Routes'); foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) { $class = substr($file, strlen($path)); $class = str_replace('/', '\\', $class); $class = substr($class, 0, -4); $this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}")->map($router); } }); } }