Support the ongoing development of Laravel.io →
posted 7 years ago
Requests

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!

Last updated 3 years ago.
0
moderator

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.

0

I feel such an idiot! Thanks Tobias!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jim1506 jim1506 Joined 12 Sep 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.