private function _seedToPhrase() { $phrase = new Phrase(); $phrase->name = 'Si cambias la forma en que miras las cosas, las cosas que miras cambian.'; $phrase->author = 'Wayne Dyer'; $phrase->save(); $phrase = new Phrase(); $phrase->name = 'Ve a por el ahora. El futuro no esta prometido a nadie.'; $phrase->author = 'Wayne Dyer'; $phrase->save(); $phrase = new Phrase(); $phrase->name = 'Cuando juzgas a otros, no los defines, te defines a ti mismo.'; $phrase->author = 'Wayne Dyer'; $phrase->save(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $event = Event::getEventOnDate(); $phrase = Phrase::getRandomPhrase(); //Get First 5 posts $posts = Post::getPredeterminatePosts(); $pathFile = ""; if ($event->image) { $pathFile = $this->_getFile($event->image); } return View("index", array("event" => $event, "phrase" => $phrase, "posts" => $posts, "pathFile" => $pathFile)); }