I have a named route in web.php:
Route::get('editFact/{id}'.'FactsController@edit')->name('editFact');
In the controller I have the following:
public function edit($id) { $fc = Item::find($id); $ct = Category::orderBy('title')->get(); return view('admin.facts.edit',['fc' => $fc, 'ct' => $ct]); }
I have defined both the models in the use area.
use App\Item; use App\Category;
The view is definitely there but when I try to access it I am getting:
Route for [admin/editFact/{id}FactsController@edit] has no action.
I have an index function in this controller that works fine:
public function index() { return view('admin.facts.index'); }
Any ideas please? Thanks!
If I check your code, you have a . between the route and action and not a ,
So you combine the two strings to one string and didn't provide a second parameter.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community