Пример #1
0
 public function save()
 {
     $person = Person::where(Person::ATTR_NAME, $this->getName())->get()[0];
     $person->slug = Util::createSlug($person->name);
     $person->biography = $this->getBiography();
     $person->image = $this->getImage();
     $person->save();
 }
Пример #2
0
 function getInfo($slug)
 {
     $person = Person::where(Person::ATTR_SLUG, $slug)->get()[0];
     if (is_null($person->biography)) {
         abort(404);
     }
     $productions = $person->productions;
     $productions = Production::sortByState($productions);
     return view("frontend/contents/person/info")->with("person", $person)->with("productions", $productions);
 }
Пример #3
0
 public static function search($name, $take = 20)
 {
     return Person::where(self::ATTR_NAME, "LIKE", "%" . $name . "%")->whereNotNull(Person::ATTR_BIOGRAPHY)->take($take)->get();
 }