404 dashboard not found
Expected Behavior
show the dashboard page
Actual Behavior
laravel 404 , page not found (in localhost/dashboard)
Steps to Reproduce the Problem
1.php artisan serve
2.login into localhost/dashboard
3. face the error
Specifications
- ORCHID Version:^3.0
- Laravel Version:^5.7
- PHP Version:7.1.3
- Database Version:sqlite3
Other Notes
no change in routes , just php artisan orchid:install
Do you see routes?
php artisan route:list
Please pay attention to the parameters:
DASHBOARD_DOMAIN=localhost
DASHBOARD_PREFIX=dashboard
They determine where the panel will be located.
How do you start the server? Possible settings .env not applied
Could you also verify that after installation, the user's model has been inherited from the inner class:
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Orchid\Platform\Models\User as Authenticatable;
use Orchid\Platform\Traits\GlobalSearchTrait;
class User extends Authenticatable implements MustVerifyEmail
{
....
}
After that create a user with the command:
php artisan orchid:admin login [email protected] password
The rights are set to the maximum at this time.
I have to close this question. I am very sorry that you couldn’t get enough of this product and I’m ready to provide further assistance if you have any problems raising it again.
I am able to login successfully. But after login, the page redirects to https://admin.test.test/dashboard and shows 404.
The subdomain and path is correct
@mathewparet
This is possible, provided that the user under whom you want to log in does not have the right to access.
The command to create a user with maximum permission (for the moment)
artisan orchid:admin
I created the used with artisan make:admin only
On Thu, 7 Feb, 2019, 5:41 PM Alexandr Chernyaev, [email protected] wrote:
@mathewparet https://github.com/mathewparet
This is possible, provided that the user under whom you want to log in does not have the right to access.
The command to create a user with maximum permission (for the moment)
artisan make:admin
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orchidsoftware/platform/issues/723#issuecomment-461394794, or mute the thread https://github.com/notifications/unsubscribe-auth/ACRg6tZlijamS6OzO3KYFI710xVVnEYiks5vLBf7gaJpZM4YfzaL .
--
Best Regards, Mathew Paret
@mathewparet Well, could you indicate your versions.
As for 404 errors, you see the page of the laravel or the page of the orchid (They are visually different).
Also please check that the session is being written and you have the necessary permissions on the directories.
The 404 error I get is from Laravel, not Orchid
Also, all permissions seem right and session files are successfully being written into.
I am using Laravel Framework 5.7.25
You can show the output of the following commands:
php artisan route:list
and
php artisan tinker
>>> config('platform.domain');
>>> config('platform.prefix');
php artisan route:list
gMac:test mathewparet$ php artisan route:list
+-----------+----------------------------------------+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------+----------------------+
| Domain | Method | URI | Name | Action | Middleware |
+-----------+----------------------------------------+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------+----------------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/user | | Closure | api,auth:api |
| test.test | GET|HEAD | dashboard | platform.index | Closure | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/announcement/{method?}/{argument?} | platform.systems.announcement | Orchid\Platform\Http\Screens\AnnouncementScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/backups/{method?}/{argument?} | platform.systems.backups | Orchid\Platform\Http\Screens\BackupScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/bulldozer/{model?}/{method?}/{argument?} | platform.bulldozer.index | Orchid\Bulldozer\Http\Screens\BootModelScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/category/create/{method?}/{argument?} | platform.systems.category.create | App\Orchid\Screens\Category\CategoryEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/category/{category}/edit/{method?}/{argument?} | platform.systems.category.edit | App\Orchid\Screens\Category\CategoryEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/category/{method?}/{argument?} | platform.systems.category | App\Orchid\Screens\Category\CategoryListScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/comments/create/{method?}/{argument?} | platform.systems.comments.create | App\Orchid\Screens\Comment\CommentEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/comments/{comments}/edit/{method?}/{argument?} | platform.systems.comments.edit | App\Orchid\Screens\Comment\CommentEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/comments/{method?}/{argument?} | platform.systems.comments | App\Orchid\Screens\Comment\CommentListScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/example/{method?}/{argument?} | platform.example | App\Orchid\Screens\ExampleScreen@handle | web,platform |
| test.test | GET|HEAD | dashboard/login | platform.login | Orchid\Platform\Http\Controllers\Auth\LoginController@showLoginForm | web,guest |
| test.test | POST | dashboard/login | platform.login.auth | Orchid\Platform\Http\Controllers\Auth\LoginController@login | web,guest |
| test.test | POST | dashboard/logout | platform.logout | Orchid\Platform\Http\Controllers\Auth\LoginController@logout | web |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/main/{method?}/{argument?} | platform.main | App\Orchid\Screens\PlatformScreen@handle | web,platform |
| test.test | POST | dashboard/password/email | platform.password.email | Orchid\Platform\Http\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail | web,guest |
| test.test | GET|HEAD | dashboard/password/reset | platform.password.request | Orchid\Platform\Http\Controllers\Auth\ForgotPasswordController@showLinkRequestForm | web,guest |
| test.test | POST | dashboard/password/reset | | Orchid\Platform\Http\Controllers\Auth\ResetPasswordController@reset | web,guest |
| test.test | GET|HEAD | dashboard/password/reset/{token} | platform.password.reset | Orchid\Platform\Http\Controllers\Auth\ResetPasswordController@showResetForm | web,guest |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/press/entities/{type}/create/{method?}/{argument?} | platform.entities.type.create | Orchid\Press\Http\Screens\EntityEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/press/entities/{type}/{method?}/{argument?} | platform.entities.type | Orchid\Press\Http\Screens\EntityListScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/press/entities/{type}/{page?}/page/{method?}/{argument?} | platform.entities.type.page | Orchid\Press\Http\Screens\EntityEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/press/entities/{type}/{post?}/edit/{method?}/{argument?} | platform.entities.type.edit | Orchid\Press\Http\Screens\EntityEditScreen@handle | web,platform |
| test.test | POST | dashboard/press/media/delete_file_folder | platform.systems.media.deleteFileFolder | Orchid\Press\Http\Controllers\MediaController@deleteFileFolder | web,platform,Closure |
| test.test | POST | dashboard/press/media/directories | platform.systems.media.getAllDirs | Orchid\Press\Http\Controllers\MediaController@getAllDirs | web,platform,Closure |
| test.test | POST | dashboard/press/media/files | platform.systems.media.files | Orchid\Press\Http\Controllers\MediaController@files | web,platform,Closure |
| test.test | POST | dashboard/press/media/move_file | platform.systems.media.moveFile | Orchid\Press\Http\Controllers\MediaController@moveFile | web,platform,Closure |
| test.test | POST | dashboard/press/media/new_folder | platform.systems.media.newFolder | Orchid\Press\Http\Controllers\MediaController@newFolder | web,platform,Closure |
| test.test | POST | dashboard/press/media/remove | platform.systems.media.remove | Orchid\Press\Http\Controllers\MediaController@remove | web,platform,Closure |
| test.test | POST | dashboard/press/media/rename_file | platform.systems.media.renameFile | Orchid\Press\Http\Controllers\MediaController@renameFile | web,platform,Closure |
| test.test | POST | dashboard/press/media/upload | platform.systems.media.upload | Orchid\Press\Http\Controllers\MediaController@upload | web,platform,Closure |
| test.test | GET|HEAD | dashboard/press/media/{parameters?} | platform.systems.media.index | Orchid\Press\Http\Controllers\MediaController@index | web,platform,Closure |
| test.test | GET|HEAD | dashboard/press/menu | platform.systems.menu.index | Orchid\Press\Http\Controllers\MenuController@index | web,platform,Closure |
| test.test | GET|HEAD | dashboard/press/menu/create | platform.systems.menu.create | Orchid\Press\Http\Controllers\MenuController@create | web,platform,Closure |
| test.test | DELETE | dashboard/press/menu/{menu} | platform.systems.menu.destroy | Orchid\Press\Http\Controllers\MenuController@destroy | web,platform,Closure |
| test.test | PUT|PATCH | dashboard/press/menu/{menu} | platform.systems.menu.update | Orchid\Press\Http\Controllers\MenuController@update | web,platform,Closure |
| test.test | GET|HEAD | dashboard/press/menu/{menu} | platform.systems.menu.show | Orchid\Press\Http\Controllers\MenuController@show | web,platform,Closure |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/roles/create/{method?}/{argument?} | platform.systems.roles.create | App\Orchid\Screens\Role\RoleEditScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/roles/{method?}/{argument?} | platform.systems.roles | App\Orchid\Screens\Role\RoleListScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/roles/{roles}/edit/{method?}/{argument?} | platform.systems.roles.edit | App\Orchid\Screens\Role\RoleEditScreen@handle | web,platform |
| test.test | POST | dashboard/search/{query} | platform.search | Orchid\Platform\Http\Controllers\Systems\SearchController@index | web,platform |
| test.test | GET|HEAD | dashboard/systems | platform.systems.index | Orchid\Platform\Http\Controllers\Systems\SystemController@index | web,platform,Closure |
| test.test | GET|HEAD | dashboard/systems/cache | platform.systems.cache | Orchid\Platform\Http\Controllers\Systems\CacheController@store | web,platform |
| test.test | POST | dashboard/systems/files | platform.systems.files.upload | Orchid\Platform\Http\Controllers\Systems\AttachmentController@upload | web,platform,Closure |
| test.test | POST | dashboard/systems/files/get | platform.systems.files.getFilesByIds | Closure | web,platform |
| test.test | PUT | dashboard/systems/files/post/{id} | platform.systems.files.update | Orchid\Platform\Http\Controllers\Systems\AttachmentController@update | web,platform,Closure |
| test.test | POST | dashboard/systems/files/sort | platform.systems.files.sort | Orchid\Platform\Http\Controllers\Systems\AttachmentController@sort | web,platform,Closure |
| test.test | DELETE | dashboard/systems/files/{id} | platform.systems.files.destroy | Orchid\Platform\Http\Controllers\Systems\AttachmentController@destroy | web,platform,Closure |
| test.test | POST | dashboard/systems/notification/read | platform.notification.read | Orchid\Platform\Http\Controllers\Systems\NotificationController@markAllAsRead | web,platform |
| test.test | POST | dashboard/systems/notification/remove | platform.notification.remove | Orchid\Platform\Http\Controllers\Systems\NotificationController@remove | web,platform |
| test.test | GET|HEAD | dashboard/systems/tags/{tags?} | platform.systems.tag.search | Orchid\Platform\Http\Controllers\Systems\TagsController@show | web,platform |
| test.test | POST | dashboard/systems/widget/{widget}/{key?} | platform.systems.widget | Orchid\Platform\Http\Controllers\Systems\WidgetController@index | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/users/{method?}/{argument?} | platform.systems.users | App\Orchid\Screens\User\UserListScreen@handle | web,platform |
| test.test | GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | dashboard/users/{users}/edit/{method?}/{argument?} | platform.systems.users.edit | App\Orchid\Screens\User\UserEditScreen@handle | web,platform |
| test.test | GET|HEAD | dashboard/{fallbackPlaceholder} | | Closure | web,platform |
+-----------+----------------------------------------+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------+----------------------+
Tinker:
gMac:test mathewparet$ php artisan tinker
Psy Shell v0.9.9 (PHP 7.3.1 — cli) by Justin Hileman
>>> config('platform.domain')
=> "test.test"
>>> config('platform.prefix')
=> "dashboard"
>>> exit
Exit: Goodbye
gMac:test mathewparet
@mathewparet
Your domains do not match, you refer to: https://admin.test.test/dashboard , but the parameters indicate otherwise (http://test.test/dashboard). bring them to one form. Do not forget to clear the cache
That's because I re-installed it in an effort to try fix it and when I reinstalled I setup the url as test.test
Now I refer to https://test.test/dashboard
It asks me to login and after that I fall back to Laravel 404
@mathewparet
Good, but I am still convinced that the problem is due to the environment.
Could you just create a simple authorization using the command make:auth and tell if it works?
So I'll just do make:auth?
Since the user tables are quite similar (you only have extra fields), I believe I do not need to run the user table migration. Correct?
On Fri, 8 Feb, 2019, 12:34 AM Alexandr Chernyaev, [email protected] wrote:
@mathewparet https://github.com/mathewparet
Good, but I am still convinced that the problem is due to the environment. Could you just create a simple authorization using the command make:auth and tell if it works?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orchidsoftware/platform/issues/723#issuecomment-461555210, or mute the thread https://github.com/notifications/unsubscribe-auth/ACRg6srp0OxEzFSamotR5Z-C9dN-TTToks5vLHivgaJpZM4YfzaL .
--
Best Regards, Mathew Paret
I ran php artisan make:auth and then tried test.test/dashboard/login (the old orchid login page came up). Then I went to test.test/login to use the laravel inbuild login. After login it went back to inbuilt /home page. But then when I go it /dashboard again it shows 404
excellent, it gives me a lot of information to identify the problem, but could you dump the user:
php artisan tinker: dd (App \ User :: find (1)):
Most likely the user model was not inherited
gMac:test mathewparet$ php artisan tinker
Psy Shell v0.9.9 (PHP 7.3.1 — cli) by Justin Hileman
>>> dd(App\User::find(1))
App\User {#3225
#fillable: array:3 [
0 => "name"
1 => "email"
2 => "password"
]
#hidden: array:2 [
0 => "password"
1 => "remember_token"
]
#casts: array:1 [
"email_verified_at" => "datetime"
]
#table: "users"
#allowedFilters: array:4 [
0 => "id"
1 => "name"
2 => "email"
3 => "permissions"
]
#allowedSorts: array:3 [
0 => "id"
1 => "name"
2 => "email"
]
#connection: "mysql"
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#attributes: array:10 [
"id" => 1
"name" => "Mathew Paret"
"email" => "[email protected]"
"email_verified_at" => null
"password" => "$2y$10$XQzD/9NSR3qzhC73gmCDieKGnzrNvBsNj3apwJG1NgaNhw.muByzy"
"remember_token" => null
"created_at" => "2019-02-07 16:08:00"
"updated_at" => "2019-02-08 04:31:52"
"last_login" => "2019-02-08 04:31:52"
"permissions" => "{"platform.index": true, "platform.systems": true, "platform.bulldozer": true, "platform.systems.menu": true, "platform.systems.cache": true, "platform.systems.index": true, "platform.systems.media": true, "platform.systems.roles": true, "platform.systems.users": true, "platform.systems.backups": true, "platform.systems.category": true, "platform.systems.comments": true, "platform.systems.attachment": true, "platform.systems.announcement": true, "platform.entities.type.example-page": true, "platform.entities.type.example-post": true}"
]
#original: array:10 [
"id" => 1
"name" => "Mathew Paret"
"email" => "[email protected]"
"email_verified_at" => null
"password" => "$2y$10$XQzD/9NSR3qzhC73gmCDieKGnzrNvBsNj3apwJG1NgaNhw.muByzy"
"remember_token" => null
"created_at" => "2019-02-07 16:08:00"
"updated_at" => "2019-02-08 04:31:52"
"last_login" => "2019-02-08 04:31:52"
"permissions" => "{"platform.index": true, "platform.systems": true, "platform.bulldozer": true, "platform.systems.menu": true, "platform.systems.cache": true, "platform.systems.index": true, "platform.systems.media": true, "platform.systems.roles": true, "platform.systems.users": true, "platform.systems.backups": true, "platform.systems.category": true, "platform.systems.comments": true, "platform.systems.attachment": true, "platform.systems.announcement": true, "platform.entities.type.example-page": true, "platform.entities.type.example-post": true}"
]
#changes: []
#dates: []
#dateFormat: null
#appends: []
#dispatchesEvents: []
#observables: []
#relations: []
#touches: []
+timestamps: true
#visible: []
#guarded: array:1 [
0 => "*"
]
#rememberTokenName: "remember_token"
-cachePermissions: null
+jsonColumnName: "content"
}
gMac:test mathewparet$
Looks like it is already inherited Orchid's model. I found this in App\User.php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Orchid\Platform\Models\User as Authenticatable;
class User extends Authenticatable
{
What does your user return?
php artisan tinker: $user->hasAccess(“platform.index“)
gMac:test mathewparet$ php artisan tinker
Psy Shell v0.9.9 (PHP 7.3.1 — cli) by Justin Hileman
>>> $user = App\User::find(1);
=> App\User {#3225
id: 1,
name: "Mathew Paret",
email: "[email protected]",
email_verified_at: null,
created_at: "2019-02-07 16:08:00",
updated_at: "2019-02-08 04:31:52",
last_login: "2019-02-08 04:31:52",
permissions: "{"platform.index": true, "platform.systems": true, "platform.bulldozer": true, "platform.systems.menu": true, "platform.systems.cache": true, "platform.systems.index": true, "platform.systems.media": true, "platform.systems.roles": true, "platform.systems.users": true, "platform.systems.backups": true, "platform.systems.category": true, "platform.systems.comments": true, "platform.systems.attachment": true, "platform.systems.announcement": true, "platform.entities.type.example-page": true, "platform.entities.type.example-post": true}",
}
>>> $user->hasAccess("platform.index");
=> false
>>> exit
Exit: Goodbye
gMac:test mathewparet$
This is very strange, as you see in the user rights the specified value goes as true.
I still think that this is because of the update of the model of the User, and more precisely because of this line:
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
Because it replaces the base value:
/**
* @var array
*/
protected $casts = [
'permissions' => 'array',
];
Please add it now manually to your model.