public function edit($id) { if (!preg_match("/^[1-9]\\d*\$/", $id)) { return Redirect::to('/'); } $person = Person::find($id); if (!$person) { return Redirect::to(route('admin.persons.index')); } if ($person->hash == '') { $person->hash = Hash::make(time() . rand(1000, 9999)); } return Theme::view('admin.persons.edit', compact('person')); }
public function show($id = 0) { if (!preg_match("/^[1-9]\\d*\$/", $id)) { return Redirect::to('/'); } $person = Person::find($id); if (empty($person)) { return Redirect::to('/'); } $keywords = $person->keywords; $description = $person->description; if ($person->url != '') { return Redirect::to($person->url); } return Theme::view('person.show', compact('person', 'keywords', 'description')); }