middleware(['auth' => 'breakingNewsPermissions'])->except('index', 'show'); // Model $this->modelHasFiles = false; $this->modelHasPublications = false; $this->modelType = StringHelper::toURL(__('models.breaking_news')); $this->modelData = [ 'title' => [ 'type' => 'inputText', 'label' => __('models.title'), 'placeholder' => __('models.title'), 'validation' => [ 'rules' => 'required|min:3', ] ], 'content' => [ 'type' => 'inputTextarea', 'label' => __('models.text'), 'placeholder' => __('models.text'), 'toolbar' => [ [ 'insertfile', 'undo', 'redo', ], [ 'bold', 'italic', 'strikethrough' ], [ 'link', ] ], 'plugins' => [ 'paste', 'link' ], 'validation' => [ 'rules' => 'required', ] ], ]; // URL options $this->url = 'breaking_news'; $this->route = StringHelper::toURL(__('models.breaking_news')); $this->adminIndexOptions = [ 'orderBy' => 'datetime', 'orderDirection' => 'DESC', 'paginate' => 10, 'listdata' => [ 'title' => [], 'user' => [ 'label' => __('general.author'), 'foreign' => [ 'model' => 'audits', 'column' => 'name', 'index' => 'last' ], ], 'datetime' => [ 'label' => __('general.datetime'), ], 'published' => [ 'label' => __('admin.published'), ] ] ]; parent::__construct(); } }