/** * Call model events. */ private function modelevents() { Page::saving(function ($model) { $model->upload($model); }); Page::creating(function ($model) { $model->slug = !empty($model->slug) ? $model->slug : $model->getUniqueSlug($model->name); }); }
/** * Bootstrap the application events. */ public function boot() { Page::saving(function ($model) { $model->upload($model); }); Page::creating(function ($model) { $model->slug = !empty($model->slug) ? $model->slug : $model->getUniqueSlug($model->name); }); $this->loadViewsFrom(__DIR__ . '/../../../../resources/views', 'page'); $this->loadTranslationsFrom(__DIR__ . '/../../../../resources/lang', 'page'); $this->publishResources(); include __DIR__ . '/../Http/routes.php'; }