コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, $this->rules);
     $input = $request->only('name', 'phone', 'contact', 'city', 'agent_category_id');
     $agent = Agent::firstOrCreate($input);
     $msg = "Added new Agent! {$input['name']}";
     return redirect('masterdata/agent')->with('message', $msg);
 }