Exemplo n.º 1
0
 public function add()
 {
     $input = Input::only('name', 'website', 'address', 'email', 'phone', 'comment');
     $name = $input['name'];
     $website = $input['website'];
     $address = $input['address'];
     $email = $input['email'];
     $phone = $input['phone'];
     $comment = $input['comment'];
     if (!$name) {
         return redirect()->back()->with('error_tips', '提交数据不完整')->withInput();
     }
     $manufacturer = new Manufacturer();
     $manufacturer->name = $name;
     $manufacturer->website = $website;
     $manufacturer->address = $address;
     $manufacturer->email = $email;
     $manufacturer->phone = $phone;
     $manufacturer->comment = $comment;
     $manufacturer->save();
     return redirect()->route('manufacturers')->with("success_tips", "保存成功!");
 }