-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use resource route #261
Comments
Please paste content of your Modules\Client\Http\routes.php file. |
Route::group(['middleware' => 'web', 'prefix' => 'client', 'namespace' => 'Modules\Client\Http\Controllers'], function() |
In default, ClientController doesn't have resource-like methods (store, edit, update etc.) - only index(). Do you created it in your controller file? |
Clients::get()]); } public function create() { return view('client::create'); } public function edit($id) { return view('client::edit'); } ``` } |
I'm checked it in my installation of laravel + modules. Works the same, but I'm found a workaround: define your route as (i.e.): It generates: |
Route::resource('/id', 'ClientController'); now generates client/id |
Other solutions? |
Nobody has this problem? |
When I try to access the 'client/1/edit' it throws NotFoundHttpException.
The route:list shows the following routes
GET|HEAD | client/create | client..create | Modules\Client\Http\Controllers\ClientController@create
GET|HEAD | client/{} | client..show | Modules\Client\Http\Controllers\ClientController@show
PUT|PATCH | client/{} | client..update | Modules\Client\Http\Controllers\ClientController@update
DELETE | client/{} | client..destroy | Modules\Client\Http\Controllers\ClientController@destroy
GET|HEAD | client/{}/edit | client..edit | Modules\Client\Http\Controllers\ClientController@edit
The route is:
Route::group(['middleware' => 'web', 'prefix' => 'client', 'namespace' => 'Modules\Client\Http\Controllers'], function()
{
Route::resource('/', 'ClientController');
});
The text was updated successfully, but these errors were encountered: