public function seedRandomTags($amount = 10) { $tags = new Collection(); for ($i = 0; $i < $amount; ++$i) { $tag = Tag::findByNameOrCreate($this->faker->words(2, true), TagType::NEWS_TAG()); $tags->add($tag); } return $tags; }
public function update() { parent::update(); $this->updateTags(TagType::NEWS_TAG(), TagType::NEWS_CATEGORY()); $this->model->publish_date = Carbon::createFromFormat('d/m/Y', $this->request->get('publish_date')); }