Laravel 8 Route in blade - laravel

I have the following web routes in my Laravel project
Route::resource('client/{client}/users', UserController::class);
Route::resource('users', UserController::class);
For the latter I am able to use {{ route('users.create') }} in my blade file, but I'm not sure what to put for the other one.
I need to 2 ways separate resources because some users are able to edit users from their own client (/users) and users of other clients (/client/123/users)
`php artisan route:list shows that I'm getting the same name for both. What's the correct way to name the clients-users resource?
| | GET|HEAD | client/{client}/users | users.index | App\Http\Controllers\UserController#index | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | POST | client/{client}/users | users.store | App\Http\Controllers\UserController#store | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | client/{client}/users/create | users.create | App\Http\Controllers\UserController#create | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | PUT|PATCH | client/{client}/users/{user} | users.update | App\Http\Controllers\UserController#update | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | DELETE | client/{client}/users/{user} | users.destroy | App\Http\Controllers\UserController#destroy | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | client/{client}/users/{user} | users.show | App\Http\Controllers\UserController#show | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | client/{client}/users/{user}/edit | users.edit | App\Http\Controllers\UserController#edit | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
and
| | GET|HEAD | users | users.index | App\Http\Controllers\UserController#index | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | users/create | users.create | App\Http\Controllers\UserController#create | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | DELETE | users/{user} | users.destroy | App\Http\Controllers\UserController#destroy | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | PUT|PATCH | users/{user} | users.update | App\Http\Controllers\UserController#update | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | users/{user} | users.show | App\Http\Controllers\UserController#show | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |
| | GET|HEAD | users/{user}/edit | users.edit | App\Http\Controllers\UserController#edit | web |
| | | | | | App\Http\Middleware\Authenticate:sanctum |
| | | | | | Illuminate\Auth\Middleware\EnsureEmailIsVerified |

The third arguement of the resource is an array of options, one of which allows you to specifiy a prefix.
Route::resource('client/{client}/users', UserController::class, ['as' => 'clients']);
Route::resource('users', UserController::class);
Now your routes should be
clients.users.{action}
users.{action}

You need to give it a name. That said, I don't think you want Route::resource for that route.
I'm gonna give it the name clients.users.index but you can give it whatever name you want.
Route::get('clients/{client}/users', [ClientController::class, 'users'])->name('clients.users.index');
{{ route('clients.users.index') }}
The way to handle nested resources would be to declare the route:
Route::resource('clients.users', SomeOtherController::class);

Related

Submitting a form leads to log out

Information:
Language: PHP
Framework: Laravel 9
Database: Firebase, firestore
I'm trying to input data from a form in a blade to firestore database. However, it doesn't add in the database. Also after clicking the submit button, it just redirect me to the login page. Basically, it log outs me without even having successfully adding the data input.
What I have tried so far:
as per #Aless55, there might be an error. I checked, there's none.
InventoryController:
public function store(Request $request){
$data = [
'SKU' => $request->invSKU,
'Product Name' => $request->invName,
'Stock' => $request->invStock,
'Date added' => Carbon\Carbon::now(),
'Last Update' => Carbon\Carbon::now(),
'Item sold' => '0',
'Status' => 'active'
];
$postData = $this->app('firebase.firestore')
->database()
->collection('Inventory')
->newDocument()
->set($data);
if($postData){
return redirect('admin.inventory');
} else{
return redirect('admin.inventory-add');
}
}
web.php:
//For Inventory
Route::controller(App\Http\Controllers\InventoryController::class)->group(function(){
Route::get('inventory/add', 'invAdd')->middleware('user','fireauth');
Route::post('inventory/add/product', 'store')->name('add.product');
Route::get('inventory/archive', 'invArchive')->middleware('user','fireauth');
});
form part of inventory-add blade:
<form style="padding-left: 0px;margin-left: -9px;" method="POST" action="{{Route('add.product')}}">
#csrf
<div style="display: flex;">
<div style="padding-right: 0px;margin-right: 29px;">
<h6>Name</h6><input class="form-control" type="text" style="padding-bottom: 0px;" name="invName" autocomplete="off">
</div>
<div style="padding-right: 0px;margin-right: 29px;">
<h6>SKU</h6><input class="form-control" type="text" style="padding-bottom: 0px;" name="invSKU" autocomplete="off">
</div>
<div style="padding-right: 0px;margin-right: 29px;">
<h6>Starting Stock</h6><input class="form-control" type="number" name="invStock" autocomplete="off">
</div>
</div>
<div style="display: flex;margin-top: 11px;">
</div><button class="btn btn-primary" type="submit" style="margin-top: 15px;text-align: right;margin-left: 397px;padding-right: 14px;background: #2f3192;">Submit</button>
</form>
middleware:
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Session;
class FirebaseAuth
{
/**
* Handle an incoming request.
*
* #param \Illuminate\Http\Request $request
* #param \Closure $next
* #return mixed
*/
public function handle(Request $request, Closure $next)
{
$uid = Session::get('uid');
if ($uid) {
return $next($request);
}
else {
Session::flush();
return redirect('/login');
}
}
}
Route list:
+--------+-----------+-----------------------------+------------------+-----------------------------------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+-----------+-----------------------------+------------------+-----------------------------------------------------------------------+------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/user | | Closure | api |
| | | | | | auth:api |
| | GET|HEAD | carousel | | App\Http\Controllers\NavBar#carou | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | dashboard | | App\Http\Controllers\NavBar#dboard | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | email/verify | verify | App\Http\Controllers\Auth\ResetController#verify_email | web |
| | | | | | fireauth |
| | GET|HEAD | home | home | App\Http\Controllers\HomeController#index | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | home/profile | profile.index | App\Http\Controllers\Auth\ProfileController#index | web |
| | | | | | user |
| | | | | | auth |
| | POST | home/profile | profile.store | App\Http\Controllers\Auth\ProfileController#store | web |
| | | | | | user |
| | | | | | auth |
| | GET|HEAD | home/profile/create | profile.create | App\Http\Controllers\Auth\ProfileController#create | web |
| | | | | | user |
| | | | | | auth |
| | GET|HEAD | home/profile/{profile} | profile.show | App\Http\Controllers\Auth\ProfileController#show | web |
| | | | | | user |
| | | | | | auth |
| | PUT|PATCH | home/profile/{profile} | profile.update | App\Http\Controllers\Auth\ProfileController#update | web |
| | | | | | user |
| | | | | | auth |
| | DELETE | home/profile/{profile} | profile.destroy | App\Http\Controllers\Auth\ProfileController#destroy | web |
| | | | | | user |
| | | | | | auth |
| | GET|HEAD | home/profile/{profile}/edit | profile.edit | App\Http\Controllers\Auth\ProfileController#edit | web |
| | | | | | user |
| | | | | | auth |
| | GET|HEAD | img | img.index | App\Http\Controllers\ImageController#index | web |
| | POST | img | img.store | App\Http\Controllers\ImageController#store | web |
| | GET|HEAD | img/create | img.create | App\Http\Controllers\ImageController#create | web |
| | GET|HEAD | img/{img} | img.show | App\Http\Controllers\ImageController#show | web |
| | PUT|PATCH | img/{img} | img.update | App\Http\Controllers\ImageController#update | web |
| | DELETE | img/{img} | img.destroy | App\Http\Controllers\ImageController#destroy | web |
| | GET|HEAD | img/{img}/edit | img.edit | App\Http\Controllers\ImageController#edit | web |
| | GET|HEAD | inventory | | App\Http\Controllers\NavBar#inv | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | inventory/add | | App\Http\Controllers\InventoryController#invAdd | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | POST | inventory/add/product | add.product | App\Http\Controllers\InventoryController#store | web |
| | | | | | auth |
| | GET|HEAD | inventory/archive | | App\Http\Controllers\InventoryController#invArchive | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | login | login | App\Http\Controllers\Auth\LoginController#showLoginForm | web |
| | | | | | guest |
| | POST | login | | App\Http\Controllers\Auth\LoginController#login | web |
| | | | | | guest |
| | POST | login/{provider}/callback | | App\Http\Controllers\Auth\LoginController#handleCallback | web |
| | | | | | guest |
| | POST | logout | logout | App\Http\Controllers\Auth\LoginController#logout | web |
| | GET|HEAD | notification | | App\Http\Controllers\NavBar#notif | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | notification/deleted | | App\Http\Controllers\NotificationController#notifRecDel | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | POST | notification/push | push | App\Http\Controllers\NotificationController#store | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | order | | App\Http\Controllers\NavBar#order | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | password/confirm | password.confirm | App\Http\Controllers\Auth\ConfirmPasswordController#showConfirmForm | web |
| | | | | | auth |
| | POST | password/confirm | | App\Http\Controllers\Auth\ConfirmPasswordController#confirm | web |
| | | | | | auth |
| | POST | password/email | password.email | App\Http\Controllers\Auth\ForgotPasswordController#sendResetLinkEmail | web |
| | GET|HEAD | password/reset | reset.index | App\Http\Controllers\Auth\ResetController#index | web |
| | POST | password/reset | reset.store | App\Http\Controllers\Auth\ResetController#store | web |
| | GET|HEAD | password/reset/create | reset.create | App\Http\Controllers\Auth\ResetController#create | web |
| | GET|HEAD | password/reset/{reset} | reset.show | App\Http\Controllers\Auth\ResetController#show | web |
| | PUT|PATCH | password/reset/{reset} | reset.update | App\Http\Controllers\Auth\ResetController#update | web |
| | DELETE | password/reset/{reset} | reset.destroy | App\Http\Controllers\Auth\ResetController#destroy | web |
| | GET|HEAD | password/reset/{reset}/edit | reset.edit | App\Http\Controllers\Auth\ResetController#edit | web |
| | GET|HEAD | password/reset/{token} | password.reset | App\Http\Controllers\Auth\ResetPasswordController#showResetForm | web |
| | GET|HEAD | product | | App\Http\Controllers\NavBar#prod | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | product/add | | App\Http\Controllers\ProductController#prodAdd | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | product/archive | | App\Http\Controllers\ProductController#prodArchive | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | register | register | App\Http\Controllers\Auth\RegisterController#showRegistrationForm | web |
| | | | | | guest |
| | POST | register | | App\Http\Controllers\Auth\RegisterController#register | web |
| | | | | | guest |
| | GET|HEAD | report | | App\Http\Controllers\NavBar#report | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | settings | | App\Http\Controllers\NavBar#settings | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | settings/payment/add | | App\Http\Controllers\SettingsController#payAdd | web |
| | | | | | auth |
| | GET|HEAD | shipping | | App\Http\Controllers\NavBar#ship | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
| | GET|HEAD | shipping/add | | App\Http\Controllers\ShippingController#shipAdd | web |
| | | | | | user |
| | | | | | fireauth |
| | | | | | auth |
+--------+-----------+-----------------------------+------------------+-----------------------------------------------------------------------+------------+
I have this side menu and the logout part used to be like this
<li class="nav-item"><a class="nav-link" href="" onclick="event.preventDefault();
document.getElementById('logout-form').submit();"><span></span><strong style="font-size: 16.6px;"><img src="{{ asset('build/img/vectors/logout%20icon.png?h=dbf300e18e83c66a9b08989511fc388a')}}"> Sign out</strong></a></li>
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
#csrf
</form>
I removed the form and leave the {{ route('logout') }}
and my solution:
<li class="nav-item"><a class="nav-link" href="{{ route('logout')}}"><span></span><strong style="font-size: 16.6px;"><img src="{{ asset('build/img/vectors/logout%20icon.png?h=dbf300e18e83c66a9b08989511fc388a')}}"> Sign out</strong></a></li>

laravel ui auth /login 404 not found

i cant access the auth pages it always redirect 404 not found .
it was work just fine before ,i dont know whats going on suddenly
this is my route file
Route::get('/', function () {
return redirect(app()->getLocale());
});
Auth::routes();
and this my route list
+--------+----------------------------------------+------------------------------------------------------------+------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------+
| Domain | Method | URI | Name | Action
| Middleware |
+--------+----------------------------------------+------------------------------------------------------------+------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------+
| | |
| App\Http\Middleware\RedirectIfAuthenticated |
| | POST | login | generated::csqSXSmjhYevTLX7 | App\Http\Controllers\Auth\LoginController#login | web |
| | | | |
| App\Http\Middleware\RedirectIfAuthenticated |
| | POST | logout | logout | App\Http\Controllers\Auth\LoginController#logout | web |
| | GET|HEAD | password/confirm | password.confirm | App\Http\Controllers\Auth\ConfirmPasswordController#showConfirmForm | web |
| | | | |
| App\Http\Middleware\Authenticate |
| | POST | password/confirm | generated::FOcpGH5OrG9S8e7r | App\Http\Controllers\Auth\ConfirmPasswordController#confirm | web |
| | | | |
| App\Http\Middleware\Authenticate |
| | POST | password/email | password.email | App\Http\Controllers\Auth\ForgotPasswordController#sendResetLinkEmail | web |
| | GET|HEAD | password/reset | password.request | App\Http\Controllers\Auth\ForgotPasswordController#showLinkRequestForm | web |
| | POST | password/reset | password.update | App\Http\Controllers\Auth\ResetPasswordController#reset | web |
| | GET|HEAD | password/reset/{token} | password.reset | App\Http\Controllers\Auth\ResetPasswordController#showResetForm | web |
| | GET|HEAD | register | register | App\Http\Controllers\Auth\RegisterController#showRegistrationForm | web |
| | | | |
| App\Http\Middleware\RedirectIfAuthenticated |
| | POST | register | generated::28dngmMiIB5ZE1p8 | App\Http\Controllers\Auth\RegisterController#register | web |
| | | | |
|
| | GET|HEAD | {locale} | site.index | App\Http\Controllers\Site\HomeController#index | web |
| | | | |
| App\Http\Middleware\SetLocale |
| | GET|HEAD | {locale}/chooseus/{chooseus} | site.chooseus.detail | App\Http\Controllers\Site\ChooseusController#detail | web |
| | | | |
| App\Http\Middleware\SetLocale |
| | POST | {locale}/contact-us/send | site.contact.send | App\Http\Controllers\Site\ContactController#send | web |
| | | | |
+--------+----------------------------------------+------------------------------------------------------------+------------------------------+------------------------------------------------------------------------+-------------------------------------------------------------+
i tried to reinstall laravel ui but that didn't work
Your route {locale} may que interfering with the login route. Since both are first level routes, the {locale} is taking precedence, therefore not showing you the `login`` route.
You should consider using other route syntax, like /content/{locale} for example.

Laravel route undefined but it is clearly defined

I am having problems getting some routes to work. I have clearly declared some routes that just don't show up in php artisan route:list, even after clearing the cache.
Since I think this may be related to another line not being correct, I have pasted the entire routes file here. All the admin routes are working, but some "pro" and some "shop" routes are missing completely! There are several missing, so I will not list them all. I am out of thoughts as to how this is happening.
Auth::routes();
Route::prefix('cms')->middleware(['role:admin'])->namespace('Admin')->name('cms.admin.')->group(function () {
Route::get('', 'CmsController#index')->name('index');
Route::get('instellingen', 'CmsController#getSetting')->name('setting.get');
Route::match(['put', 'patch'], 'instellingen', 'CmsController#updateSetting')->name('setting.update');
Route::resource('coaches', 'ProController')->names('pro');
Route::resource('winkels', 'ShopController')->names('shop');
Route::resource('adviezen', 'AdviceController')->names('advice');
Route::resource('notificaties', 'NotificationController')->names('notification');
});
Route::prefix('account')->name('account.')->group(function () {
Route::middleware(['role:shop'])->namespace('Shop')->name('shop.')->group(function () {
Route::get('', 'AccountController#index')->name('index');
Route::get('instellingen', 'AccountController#getSetting')->name('setting.get');
Route::match(['put', 'patch'], 'instellingen', 'AccountController#postSetting')->name('setting.post');
Route::get('profiel', 'AccountController#getProfile')->name('profile.get');
Route::match(['put', 'patch'], 'profiel', 'AccountController#postProfile')->name('profile.post');
Route::get('coaches', 'AccountController#getPro')->name('pro.get');
Route::match(['put', 'patch'], 'coaches', 'AccountController#postPro')->name('pro.post');
Route::resource('adviezen', 'AdviceController')->names('advice');
});
Route::middleware(['role:pro'])->namespace('Pro')->name('pro.')->group(function () {
Route::get('', 'AccountController#index')->name('index');
Route::get('profiel', 'AccountController#getProfile')->name('profile.get');
Route::match(['put', 'patch', 'delete'], 'profiel', 'AccountController#postProfile')->name('profile.post');
Route::get('winkel', 'AccountController#getShop')->name('shop.get');
Route::match(['post', 'delete'], 'winkel', 'AccountController#postShop')->name('shop.post');
Route::get('postvak', 'AccountController#getNotification')->name('notification.get');
Route::post('postvak', 'AccountController#postNotification')->name('notification.post');
Route::resource('adviezen', 'AdviceController')->names('advice');
});
});
Route::get('', 'SiteController#index')->name('site.index');
Result when printing the php artisan route:list -c (Yes, I know this is quite a lot of text, but I think it is necessary to see the complete picture and might help in the solving of this particular problem)
+------------------+------------------------------------+------------------------------------------------------------------------+
| Method | URI | Action |
+------------------+------------------------------------+------------------------------------------------------------------------+
| GET|HEAD | / | App\Http\Controllers\SiteController#index |
| GET|HEAD | _debugbar/assets/javascript | Barryvdh\Debugbar\Controllers\AssetController#js |
| GET|HEAD | _debugbar/assets/stylesheets | Barryvdh\Debugbar\Controllers\AssetController#css |
| DELETE | _debugbar/cache/{key}/{tags?} | Barryvdh\Debugbar\Controllers\CacheController#delete |
| GET|HEAD | _debugbar/clockwork/{id} | Barryvdh\Debugbar\Controllers\OpenHandlerController#clockwork |
| GET|HEAD | _debugbar/open | Barryvdh\Debugbar\Controllers\OpenHandlerController#handle |
| GET|HEAD | _debugbar/telescope/{id} | Barryvdh\Debugbar\Controllers\TelescopeController#show |
| GET|HEAD | account | App\Http\Controllers\Pro\AccountController#index |
| POST | account/adviezen | App\Http\Controllers\Pro\AdviceController#store |
| GET|HEAD | account/adviezen | App\Http\Controllers\Pro\AdviceController#index |
| GET|HEAD | account/adviezen/create | App\Http\Controllers\Pro\AdviceController#create |
| PUT|PATCH | account/adviezen/{adviezen} | App\Http\Controllers\Pro\AdviceController#update |
| GET|HEAD | account/adviezen/{adviezen} | App\Http\Controllers\Pro\AdviceController#show |
| DELETE | account/adviezen/{adviezen} | App\Http\Controllers\Pro\AdviceController#destroy |
| GET|HEAD | account/adviezen/{adviezen}/edit | App\Http\Controllers\Pro\AdviceController#edit |
| PUT|PATCH | account/coaches | App\Http\Controllers\Shop\AccountController#postPro |
| GET|HEAD | account/coaches | App\Http\Controllers\Shop\AccountController#getPro |
| GET|HEAD | account/instellingen | App\Http\Controllers\Shop\AccountController#getSetting |
| PUT|PATCH | account/instellingen | App\Http\Controllers\Shop\AccountController#postSetting |
| GET|HEAD | account/postvak | App\Http\Controllers\Pro\AccountController#getNotification |
| POST | account/postvak | App\Http\Controllers\Pro\AccountController#postNotification |
| PUT|PATCH|DELETE | account/profiel | App\Http\Controllers\Pro\AccountController#postProfile |
| PUT|PATCH | account/profiel | App\Http\Controllers\Shop\AccountController#postProfile |
| GET|HEAD | account/profiel | App\Http\Controllers\Pro\AccountController#getProfile |
| GET|HEAD | account/winkel | App\Http\Controllers\Pro\AccountController#getShop |
| POST|DELETE | account/winkel | App\Http\Controllers\Pro\AccountController#postShop |
| GET|HEAD | api/user | Closure |
| GET|HEAD | cms | App\Http\Controllers\Admin\CmsController#index |
| GET|HEAD | cms/adviezen | App\Http\Controllers\Admin\AdviceController#index |
| POST | cms/adviezen | App\Http\Controllers\Admin\AdviceController#store |
| GET|HEAD | cms/adviezen/create | App\Http\Controllers\Admin\AdviceController#create |
| PUT|PATCH | cms/adviezen/{adviezen} | App\Http\Controllers\Admin\AdviceController#update |
| DELETE | cms/adviezen/{adviezen} | App\Http\Controllers\Admin\AdviceController#destroy |
| GET|HEAD | cms/adviezen/{adviezen} | App\Http\Controllers\Admin\AdviceController#show |
| GET|HEAD | cms/adviezen/{adviezen}/edit | App\Http\Controllers\Admin\AdviceController#edit |
| GET|HEAD | cms/coaches | App\Http\Controllers\Admin\ProController#index |
| POST | cms/coaches | App\Http\Controllers\Admin\ProController#store |
| GET|HEAD | cms/coaches/create | App\Http\Controllers\Admin\ProController#create |
| GET|HEAD | cms/coaches/{coach} | App\Http\Controllers\Admin\ProController#show |
| DELETE | cms/coaches/{coach} | App\Http\Controllers\Admin\ProController#destroy |
| PUT|PATCH | cms/coaches/{coach} | App\Http\Controllers\Admin\ProController#update |
| GET|HEAD | cms/coaches/{coach}/edit | App\Http\Controllers\Admin\ProController#edit |
| PUT|PATCH | cms/instellingen | App\Http\Controllers\Admin\CmsController#updateSetting |
| GET|HEAD | cms/instellingen | App\Http\Controllers\Admin\CmsController#getSetting |
| GET|HEAD | cms/notificaties | App\Http\Controllers\Admin\NotificationController#index |
| POST | cms/notificaties | App\Http\Controllers\Admin\NotificationController#store |
| GET|HEAD | cms/notificaties/create | App\Http\Controllers\Admin\NotificationController#create |
| GET|HEAD | cms/notificaties/{notificaty} | App\Http\Controllers\Admin\NotificationController#show |
| PUT|PATCH | cms/notificaties/{notificaty} | App\Http\Controllers\Admin\NotificationController#update |
| DELETE | cms/notificaties/{notificaty} | App\Http\Controllers\Admin\NotificationController#destroy |
| GET|HEAD | cms/notificaties/{notificaty}/edit | App\Http\Controllers\Admin\NotificationController#edit |
| POST | cms/winkels | App\Http\Controllers\Admin\ShopController#store |
| GET|HEAD | cms/winkels | App\Http\Controllers\Admin\ShopController#index |
| GET|HEAD | cms/winkels/create | App\Http\Controllers\Admin\ShopController#create |
| GET|HEAD | cms/winkels/{winkel} | App\Http\Controllers\Admin\ShopController#show |
| DELETE | cms/winkels/{winkel} | App\Http\Controllers\Admin\ShopController#destroy |
| PUT|PATCH | cms/winkels/{winkel} | App\Http\Controllers\Admin\ShopController#update |
| GET|HEAD | cms/winkels/{winkel}/edit | App\Http\Controllers\Admin\ShopController#edit |
| GET|HEAD | login | App\Http\Controllers\Auth\LoginController#showLoginForm |
| POST | login | App\Http\Controllers\Auth\LoginController#login |
| POST | logout | App\Http\Controllers\Auth\LoginController#logout |
| POST | password/confirm | App\Http\Controllers\Auth\ConfirmPasswordController#confirm |
| GET|HEAD | password/confirm | App\Http\Controllers\Auth\ConfirmPasswordController#showConfirmForm |
| POST | password/email | App\Http\Controllers\Auth\ForgotPasswordController#sendResetLinkEmail |
| GET|HEAD | password/reset | App\Http\Controllers\Auth\ForgotPasswordController#showLinkRequestForm |
| POST | password/reset | App\Http\Controllers\Auth\ResetPasswordController#reset |
| GET|HEAD | password/reset/{token} | App\Http\Controllers\Auth\ResetPasswordController#showResetForm |
| POST | register | App\Http\Controllers\Auth\RegisterController#register |
| GET|HEAD | register | App\Http\Controllers\Auth\RegisterController#showRegistrationForm |
+------------------+------------------------------------+------------------------------------------------------------------------+
It is not a syntax error, since my IDE does not give an error, so I am thinking it might be a logical one or something I am completely missing...
Any help would be much appreciated.
Kind regards,
Niels
Although the result was pretty embarrassing;
What I did was register multiple routes with the same URI and method. Although they had different namespaces and names, it conflicted.
Fixed by prefixing the URI in the 2 separate groups
Thanks to user lagbox for the answer.

Laravel 5.4 passport not found route

I'm using Laravel Framework version 5.4.36 and i have setup success passport,i have run command
php artisan vendor:publish --tag=passport-components
My routes:
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+-----------------------------------------+------------+----------------------------------------------------------------------------+--------------+
| | GET|HEAD | / | | Closure | web |
| | POST | api/details | | App\Http\Controllers\API\UserController#details | api,auth:api |
| | POST | api/login | | App\Http\Controllers\API\UserController#login | api |
| | GET|HEAD | api/loginError | loginError | App\Http\Controllers\API\UserController#loginError | api |
| | POST | api/register | | App\Http\Controllers\API\UserController#register | api |
| | GET|HEAD | api/test | test | App\Http\Controllers\API\UserController#test | api,auth:api |
| | GET|HEAD | api/user | | Closure | api,auth:api |
| | GET|HEAD | home | home | App\Http\Controllers\HomeController#index | web,auth |
| | GET|HEAD | oauth/authorize | | \Laravel\Passport\Http\Controllers\AuthorizationController#authorize | web,auth |
| | POST | oauth/authorize | | \Laravel\Passport\Http\Controllers\ApproveAuthorizationController#approve | web,auth |
| | DELETE | oauth/authorize | | \Laravel\Passport\Http\Controllers\DenyAuthorizationController#deny | web,auth |
| | POST | oauth/clients | | \Laravel\Passport\Http\Controllers\ClientController#store | web,auth |
| | GET|HEAD | oauth/clients | | \Laravel\Passport\Http\Controllers\ClientController#forUser | web,auth |
| | PUT | oauth/clients/{client_id} | | \Laravel\Passport\Http\Controllers\ClientController#update | web,auth |
| | DELETE | oauth/clients/{client_id} | | \Laravel\Passport\Http\Controllers\ClientController#destroy | web,auth |
| | GET|HEAD | oauth/personal-access-tokens | | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController#forUser | web,auth |
| | POST | oauth/personal-access-tokens | | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController#store | web,auth |
| | DELETE | oauth/personal-access-tokens/{token_id} | | \Laravel\Passport\Http\Controllers\PersonalAccessTokenController#destroy | web,auth |
| | GET|HEAD | oauth/scopes | | \Laravel\Passport\Http\Controllers\ScopeController#all | web,auth |
| | POST | oauth/token | | \Laravel\Passport\Http\Controllers\AccessTokenController#issueToken | throttle |
| | POST | oauth/token/refresh | | \Laravel\Passport\Http\Controllers\TransientTokenController#refresh | web,auth |
| | GET|HEAD | oauth/tokens | | \Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController#forUser | web,auth |
| | DELETE | oauth/tokens/{token_id} | | \Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController#destroy | web,auth |
| | GET|HEAD | testOracle | testOracle | App\Http\Controllers\WellcomeController#testOracle | web |
I cannot found get uri oauth/clients,it is in action \Laravel\Passport\Http\Controllers\ClientController#forUser,
My error is cannot found action \Laravel\Passport\Http\Controllers\ClientController#forUser,
when i have go to folder vendor,i only see vendor\laravel\passport
passport folder
it is not have link \Laravel\Passport\Http`
How can i fix this error,thank you
Go to \vendor\laravel\passport\src folder. You will find Http folder there.

The requested URL /laravel-filemanager was not found on this server in UniSharp/laravel-filemanager

I am using UniSharp/laravel-filemanager and I've done all steps to install it , but when I want to use it i face this error :
I am using laravel 5.1 on wamp server
Not Found
The requested URL /laravel-filemanager was not found on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80
this is php artisan route:list
ndex | admin
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | area/{_missing}
| | App\Http\Controllers\HomeController#miss
ingMethod | admin
|
| | GET|HEAD | check
| | App\Http\Controllers\CheckController#get
Index |
|
| | GET|HEAD | check/index/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\CheckController#get
Index |
|
| | GET|HEAD | check/tweet/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\CheckController#get
Tweet |
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | check/{_missing}
| | App\Http\Controllers\CheckController#mis
singMethod |
|
| | GET|HEAD | dashboard
| | App\Http\Controllers\DashboardController
#getIndex | admin
|
| | GET|HEAD | dashboard/index/{one?}/{two?}/{three
?}/{four?}/{five?} | | App\Http\Controllers\DashboardController
#getIndex | admin
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | dashboard/{_missing}
| | App\Http\Controllers\DashboardController
#missingMethod | admin
|
| | GET|HEAD | index/{one?}/{two?}/{three?}/{four?}
/{five?} | | App\Http\Controllers\PublicController#ge
tIndex |
|
| | GET|HEAD | laravel-filemanager
| | Unisharp\Laravelfilemanager\controllers\
LfmController#show | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/crop
| | Unisharp\Laravelfilemanager\controllers\
CropController#getCrop | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/cropimage
| | Unisharp\Laravelfilemanager\controllers\
CropController#getCropimage | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/delete
| | Unisharp\Laravelfilemanager\controllers\
DeleteController#getDelete | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/deletefolder
| | Unisharp\Laravelfilemanager\controllers\
FolderController#getDeletefolder | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/doresize
| | Unisharp\Laravelfilemanager\controllers\
ResizeController#performResize | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/download
| | Unisharp\Laravelfilemanager\controllers\
DownloadController#getDownload | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/folders
| | Unisharp\Laravelfilemanager\controllers\
FolderController#getFolders | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/jsonitems
| | Unisharp\Laravelfilemanager\controllers\
ItemsController#getItems | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/newfolder
| | Unisharp\Laravelfilemanager\controllers\
FolderController#getAddfolder | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/rename
| | Unisharp\Laravelfilemanager\controllers\
RenameController#getRename | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | laravel-filemanager/resize
| | Unisharp\Laravelfilemanager\controllers\
ResizeController#getResize | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD|POST|PUT|PATCH|DELETE | laravel-filemanager/upload
| | Unisharp\Laravelfilemanager\controllers\
UploadController#upload | admin,\Unisharp\Laravelfilemanager\middleware
\MultiUser |
| | GET|HEAD | login
| | App\Http\Controllers\LoginController#get
Index |
|
| | POST | login/check/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\LoginController#pos
tCheck |
|
| | GET|HEAD | login/index/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\LoginController#get
Index |
|
| | GET|HEAD | login/logout/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\LoginController#get
Logout |
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | login/{_missing}
| | App\Http\Controllers\LoginController#mis
singMethod |
|
| | GET|HEAD | n/{one?}/{two?}/{three?}/{four?}/{fi
ve?} | | App\Http\Controllers\PublicController#ge
tN |
|
| | GET|HEAD | post
| | App\Http\Controllers\PostController#getI
ndex | admin
|
| | GET|HEAD | post/index/{one?}/{two?}/{three?}/{f
our?}/{five?} | | App\Http\Controllers\PostController#getI
ndex | admin
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | post/{_missing}
| | App\Http\Controllers\PostController#miss
ingMethod | admin
|
| | GET|HEAD | profile
| | App\Http\Controllers\ProfileController#g
etIndex | admin,administrator
|
| | GET|HEAD | profile/academic/{one?}/{two?}/{thre
e?}/{four?}/{five?} | | App\Http\Controllers\ProfileController#g
etAcademic | admin,academic
|
| | POST | profile/academicstaff/{one?}/{two?}/
{three?}/{four?}/{five?} | | App\Http\Controllers\ProfileController#p
ostAcademicstaff | admin,academic
|
| | POST | profile/administrator/{one?}/{two?}/
{three?}/{four?}/{five?} | | App\Http\Controllers\ProfileController#p
ostAdministrator | admin,administrator
|
| | GET|HEAD | profile/index/{one?}/{two?}/{three?}
/{four?}/{five?} | | App\Http\Controllers\ProfileController#g
etIndex | admin,administrator
|
| | GET|HEAD | profile/standard/{one?}/{two?}/{thre
e?}/{four?}/{five?} | | App\Http\Controllers\ProfileController#g
etStandard | admin,standard
|
| | POST | profile/standard/{one?}/{two?}/{thre
e?}/{four?}/{five?} | | App\Http\Controllers\ProfileController#p
ostStandard | admin,standard
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | profile/{_missing}
| | App\Http\Controllers\ProfileController#m
issingMethod | admin
|
| | GET|HEAD | register
| | App\Http\Controllers\RegisterController#
getIndex |
|
| | GET|HEAD | register/academic/{one?}/{two?}/{thr
ee?}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
getAcademic |
|
| | GET|HEAD | register/index/{one?}/{two?}/{three?
}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
getIndex |
|
| | POST | register/standard/{one?}/{two?}/{thr
ee?}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
postStandard |
|
| | GET|HEAD | register/standard/{one?}/{two?}/{thr
ee?}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
getStandard |
|
| | POST | register/store/{one?}/{two?}/{three?
}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
postStore |
|
| | POST | register/storeacademicstaff/{one?}/{
two?}/{three?}/{four?}/{five?} | | App\Http\Controllers\RegisterController#
postStoreacademicstaff |
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | register/{_missing}
| | App\Http\Controllers\RegisterController#
missingMethod |
|
| | GET|HEAD | reset
| | App\Http\Controllers\ResetPassController
#getIndex | admin
|
| | POST | reset/delete/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\ResetPassController
#postDelete | admin
|
| | GET|HEAD | reset/delete/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\ResetPassController
#getDelete | admin
|
| | GET|HEAD | reset/index/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\ResetPassController
#getIndex | admin
|
| | POST | reset/save/{one?}/{two?}/{three?}/{f
our?}/{five?} | | App\Http\Controllers\ResetPassController
#postSave | admin
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | reset/{_missing}
| | App\Http\Controllers\ResetPassController
#missingMethod | admin
|
| | GET|HEAD | seminar
| | App\Http\Controllers\SeminarController#g
etIndex | admin
|
| | POST | seminar/approve/{one?}/{two?}/{three
?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostApprove | admin,administrator
|
| | GET|HEAD | seminar/approve/{one?}/{two?}/{three
?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etApprove | admin,administrator
|
| | POST | seminar/book/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostBook | admin
|
| | GET|HEAD | seminar/book/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etBook | admin
|
| | POST | seminar/cancele/{one?}/{two?}/{three
?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostCancele | admin
|
| | POST | seminar/checktwitter/{one?}/{two?}/{
three?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostChecktwitter | admin
|
| | POST | seminar/create/{one?}/{two?}/{three?
}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostCreate | admin
|
| | POST | seminar/crop/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostCrop | admin
|
| | POST | seminar/delete/{one?}/{two?}/{three?
}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostDelete | admin
|
| | GET|HEAD | seminar/deletefile/{one?}/{two?}/{th
ree?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etDeletefile | admin
|
| | POST | seminar/edit/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostEdit | admin,seminar
|
| | GET|HEAD | seminar/edit/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etEdit | admin,seminar
|
| | GET|HEAD | seminar/index/{one?}/{two?}/{three?}
/{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etIndex | admin
|
| | GET|HEAD | seminar/new/{one?}/{two?}/{three?}/{
four?}/{five?} | | App\Http\Controllers\SeminarController#g
etNew | admin,seminar
|
| | GET|HEAD | seminar/show/{one?}/{two?}/{three?}/
{four?}/{five?} | | App\Http\Controllers\SeminarController#g
etShow | admin
|
| | POST | seminar/upimage/{one?}/{two?}/{three
?}/{four?}/{five?} | | App\Http\Controllers\SeminarController#p
ostUpimage | admin
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | seminar/{_missing}
| | App\Http\Controllers\SeminarController#m
issingMethod | admin
|
| | GET|HEAD | show/{one?}/{two?}/{three?}/{four?}/
{five?} | | App\Http\Controllers\PublicController#ge
tShow |
|
| | GET|HEAD|POST|PUT|PATCH|DELETE | {_missing}
| | App\Http\Controllers\PublicController#mi
ssingMethod |
|
+--------+--------------------------------+-------------------------------------
-------------------------------+------+-----------------------------------------
---------------------------------+----------------------------------------------
-----------+
C:\wamp\www\socms>

Resources