validate([ 'name' => 'required', 'email' => 'nullable|email', 'logo' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', 'website' => 'nullable|url', ]); $company = new Company; $company->name = $request->name; $company->email = $request->email; if ($request->hasFile('logo')) { $path = $request->file('logo')->store('logos', 'public'); $company->logo = $path; } $company->website = $request->website; $company->save(); return redirect()->route('companies.index'); } /** * Display the specified resource. */ public function show(Company $company) { // } /** * Show the form for editing the specified resource. */ public function edit(Company $company) { // } /** * Update the specified resource in storage. */ public function update(Request $request, Company $company) { // } /** * Remove the specified resource from storage. */ public function destroy(Company $company) { // } }