Closed ericksuryadinata closed 6 years ago
Where is located your controller file? That route is mapped by Luthier-CI as follow:
"admin/gate/in" => [
"GET" => "admin/Auth/AuthController/index"
]
So, your controller file must be placed in application/controllers/admin/Auth/AuthController.php
CodeIgniter controllers doesn't have actual namespaces, so that route property will be traited as an directory path.
I solved that, but now i have this
I realize that
Route::group('admin',['namespace' => 'admin'], function(){
Route::group('/',['middleware' => ['AdminMiddleware']], function(){
Route::group('profile',['namespace' => 'Profile'],function(){
Route::get('facility','ProfileController@index')->name('admin.profile.facility');
});
});
});
give me url localhost/admin//profile/ instead of localhost/admin/profile there's double / in url
so i did
Route::group('admin',['namespace' => 'admin'], function(){
Route::group('/',['middleware' => ['AdminMiddleware']], function(){
Route::group('/',['namespace' => 'Profile'],function(){
Route::get('facility','ProfileController@index',['prefix' => 'profile'])->name('admin.profile.facility');
});
});
});
this give me correct link,
any suggest, i want to write like the first function thanks,
Yes, that's a bug :disappointed: . Thanks for report it.
I've founded the reason:
A workaround, as you suggested, is this alternate syntax:
Route::group('admin',['namespace' => 'admin'], function(){
Route::group('/',['middleware' => ['AdminMiddleware']], function(){
Route::group('/',['namespace' => 'Profile'],function(){
Route::get('facility','ProfileController@index',['prefix' => 'profile'])->name('admin.profile.facility');
});
});
});
It will be fixed in the 0.3.0 release in a few days.
uhmm, thanks for the explanation and for the good work :smile: maybe i'll use that, and waiting for the update..
I have
but it give me 404, any mistake in my code?? usually i'm using this in laravel