I am getting this error (Route [companies.show] not defined.) and I don't know what to do. Actually I am updating the data in CompaniesController and data is updating but the route is not working Here is the code for that:
public function update(Request $request, Company $company){
$companyUpdate = Company::where('id', $company->id)->update(['name'=> $request->input('name'),'description'=> $request->input('description')]);
if($companyUpdate){
return redirect()->route('companies.show', ['company'=> $company->id])
->with('success' , 'Company updated successfully');
}
return back()->withInput();
And My web.php file is as follow `
Route::get('/', function () {
return view('welcome');});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::resource('/company','CompaniesController');
Thanks in advance for helping me