Open danim80 opened 8 years ago
Please paste content of your Modules\Client\Http\routes.php file.
Route::group(['middleware' => 'web', 'prefix' => 'client', 'namespace' => 'Modules\Client\Http\Controllers'], function() { Route::resource('/', 'ClientController'); });
In default, ClientController doesn't have resource-like methods (store, edit, update etc.) - only index(). Do you created it in your controller file?
<?php namespace Modules\Client\Http\Controllers;
use Pingpong\Modules\Routing\Controller; use Modules\Client\Entities\Clients;
class ClientController extends Controller {
public function index()
{
return view('client::index', ['clients'=>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.): Route::resource('/res', 'ClientController').
It generates: client/{res} client/{res}/edit etc.
Route::resource('/id', 'ClientController'); now generates
client/id client/id client/id/create client/id/{id} client/id/{id} client/id/{id} client/id/{id}/edit
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'); });