validate([ 'name' => 'required|max:255', 'description' => 'max:255', 'path' => 'present', 'is_public' => 'boolean', ]); if ($validated) { // create bucket $bucket = Bucket::create($validated); return redirect() ->route('bucket.single', [ 'id' => $bucket->id ]); } else { return back() ->withInput(); } } }