NotFoundHttpException, even though the auth framework is up and running
Closed this issue · 6 comments
I followed the setup guide, but when I try accessing the admin page, I get a NotFoundHttpException
.
Any suggestions or ideas on what I might have done wrong? Tell me if you need any files or DB structure.
Hi @Distjubo
What is the URL of the page you're trying to access? e.g. /admin or /entrust-gui/users etc
Can you paste your config/entrust-gui.php file?
Also, what version of Laravel are you using?
Hi @acoustep,
the entrust-gui.php files contents are as follows:
<?php
return [
"layout" => "entrust-gui::app",
"route-prefix" => "admin",
"pagination" => [
"users" => 5,
"roles" => 5,
"permissions" => 5,
],
"middleware" => ['web', 'entrust-gui.admin'],
"unauthorized-url" => '/login',
"middleware-role" => 'admin',
"confirmable" => false,
"users" => [
'fieldSearchable' => [],
],
];
And my version of laravel, entrust and entrust-gui according to my composer.json:
"laravel/framework": "5.3.*",
"zizaco/entrust": "5.2.x-dev",
"acoustep/entrust-gui": "5.2.x-dev"
I hope I'm not wasting your time with some stupid mistake 😄
Distjubo
Oh and I tried pretty much all the routes that were given in the example. It should be /admin
though.
Could you run php artisan route:list
and see if the entrust-gui routes show up?
This also sometimes happens when you're not logged in, and it's trying to redirect to a login page that you haven't set up.
I'd try temporarily removing entrust-gui.admin
from the middleware and then accessing /admin/users
. If it works then make sure you have the Laravel authentication setup.
Hah nevermind. This is indeed my bad, even though I would have expected this to work differently. I thought Entrust-GUI had some kind of index page, so I just typed the prefix only (localhost:8000/admin
) into the address bar.
So yeah, sorry for that. 🙂
I'd appreciate an index page though 🥇
I simply added this to the web.php routes file:
Route::get('ENTER-YOUR-ROUTE-PREFIX-HERE-FROM-entrust-gui.php', function () { return redirect()->route('entrust-gui::users.index'); });