public function up() { Schema::create('bm_field_box_settings', function ($table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->text('name'); $table->text('partial'); $table->timestamps(); }); BoxSetting::create(['name' => 'Aktualności', 'partial' => 'news']); }
/** * {@inheritdoc} */ public function onRun() { $this->category_page = $this->property('categoryPage'); $this->wide = $this->property('wide') == true; $this->type = $this->property('type'); $this->limit = $this->property('limit'); $this->subcategories = $this->property('subcategories'); $this->random = $this->property('random'); $this->is_promoted = $this->property('is_promoted'); $this->templates = $this->property('template'); $this->partial = BoxSetting::find($this->type); $this->category = Category::loadCategory($this->category_page); $this->posts = BlogPost::getPosts(['post_id' => isset($this->page['post']) ? $this->page['post']->id : null, 'category' => $this->category, 'categories_id' => $this->property('categories_id'), 'limit' => $this->limit, 'template_id' => $this->templates, 'promoted' => $this->is_promoted, 'random' => $this->random, 'subcategories' => $this->subcategories]); }