Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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'));
 }