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(); }
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); }
public static function search($name, $take = 20) { return Person::where(self::ATTR_NAME, "LIKE", "%" . $name . "%")->whereNotNull(Person::ATTR_BIOGRAPHY)->take($take)->get(); }