Cannot access admin backend after aimeos package inclusion

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Lyshatt
Posts: 8
Joined: 23 Sep 2021, 09:51

Cannot access admin backend after aimeos package inclusion

Post by Lyshatt » 23 Sep 2021, 10:03

Hello, I am using Laravel Framework Version 7.30.4 with php 7.4 and Aimeos 2021.07 on an Windows Environment and have the following problem.
I followed the instructions to include the aimeos package into an existing laravel project. I set up the aimeos example data and because our page uses localisation, I changed the route config unter /config/shop.php and can now access the shop e.g. through /en/shop, so everything basically works so far. We also already had existing users, which where extended through aimeos' migrations to include the superuser column and so on. I manually set the superuser value to 1 for the users which should be able to access the aimeos admin dashboard.
Now, when I try to access /en/admin while logged in with a superuser, I somegow get an 302 redirect to the login page (which then redirects me again to our index page, which makes sense as the user is already logged in).
I did not manually add any routes to /routes/web.php as it seems like I didn't need to, seeing how /en/store etc works fine as is.
Thanks for any hints on how to fix the issue!

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: Cannot access admin backend after aimeos package inclusion

Post by aimeos » 24 Sep 2021, 06:57

Please use the "artisan aimeos:account" command as described there to update accounts and set superuser/admin/editor privileges:
https://github.com/aimeos/aimeos-laravel#create-account
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Lyshatt
Posts: 8
Joined: 23 Sep 2021, 09:51

Re: Cannot access admin backend after aimeos package inclusion

Post by Lyshatt » 24 Sep 2021, 09:37

I had already tried using the "artisan aimeos:account" command, but what I missed was defining the "admin" gate inside the AuthServiceProvider. It seems to work now after I defined it. Thank you!

Post Reply