/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $news = new News();
     $news->category_id = 3;
     $news->user_id = 1;
     $news->slug = 'teste-noticia';
     $news->setCreatedAt(\Carbon\Carbon::now());
     $news->setUpdatedAt(\Carbon\Carbon::now());
     $news->save();
     $t1 = new Infrastructure\Models\Translation();
     $t1->lang_id = 1;
     $t1->table = 'news';
     $t1->table_id = $news->id;
     $t1->key = 'Noticia Exemplo';
     $t1->value = 'Corpo noticia exemplo';
     $t1->save();
     $t2 = new Infrastructure\Models\Translation();
     $t2->lang_id = 1;
     $t2->table = 'news';
     $t2->table_id = $news->id;
     $t2->key = 'News Example';
     $t2->value = 'Corpo noticia exemplo';
     $t2->save();
     $t3 = new Infrastructure\Models\Translation();
     $t3->lang_id = 1;
     $t3->table = 'news';
     $t3->table_id = $news->id;
     $t3->key = 'Noticia Ejemplo';
     $t3->value = 'Corpo noticia exemplo';
     $t3->save();
 }
Exemplo n.º 2
0
 /**
  * Return all news
  *
  * @return mixed
  */
 public function getAll()
 {
     return News::all();
 }