Example #1
0
 public function teacherEdit()
 {
     $v = Validator::make(Input::all(), ['id' => 'required|numeric']);
     if ($v->fails()) {
         return View::getBadRequstView($v->messages());
     } else {
         if (Teacher::find(Input::get('id')) == null) {
             return View::getBadRequstView('no teach of this id. id is ' . Input::get('id'));
         }
     }
     $teacher = Teacher::find(Input::get('id'));
     $data = ['id' => $teacher->id, 'name' => $teacher->name, 'picture' => $teacher->picture, 'synopsis' => $teacher->synopsis, 'taxonomy' => $teacher->taxonomy, 'famous' => $teacher->famous, 'description' => $teacher->description];
     return View::getAdminTeacherEditView($data);
 }