/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $this->validate($request, ['url' => 'url|required|max:100']); $site = Site::updateOrCreate(['id' => $request->input('id')], $request->except('_token')); return redirect('/site'); }