add middleware for the admin panel routes

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!
User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

add middleware for the admin panel routes

Post by ahmed31916 » 13 Jul 2022, 09:29

Hello,

How can I add a middleware for the admin panel routes?
Do I need to copy the admin routers in the aimeos vendor files to my web route?

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: add middleware for the admin panel routes

Post by ahmed31916 » 14 Jul 2022, 08:34

@aimeos help me please!

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

Re: add middleware for the admin panel routes

Post by aimeos » 14 Jul 2022, 17:23

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: add middleware for the admin panel routes

Post by ahmed31916 » 18 Jul 2022, 14:13

ok, now if I want to add a middleware for the checkout route, how can I do?
I tried to add it to this line, but shop page will affected.
https://github.com/aimeos/aimeos/blob/9 ... op.php#L38

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

Re: add middleware for the admin panel routes

Post by aimeos » 19 Jul 2022, 04:49

This is correct because the checkout route is part of the "default" group:
https://github.com/aimeos/aimeos-larave ... #L199-L226
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: add middleware for the admin panel routes

Post by ahmed31916 » 19 Jul 2022, 06:06

aimeos wrote: 19 Jul 2022, 04:49 This is correct because the checkout route is part of the "default" group:
https://github.com/aimeos/aimeos-larave ... #L199-L226
Ok. that woks. But the "/shop" page affected with the middelware.
I add "auth" middleware for the route "default", now you need to login before browsing the "/shop" page.

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

Re: add middleware for the admin panel routes

Post by aimeos » 19 Jul 2022, 06:29

You can disable the "default" routes and add them to your ./routes/web.php with different middlewares instead.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ahmed31916
Advanced
Posts: 148
Joined: 14 Apr 2022, 12:15

Re: add middleware for the admin panel routes

Post by ahmed31916 » 19 Jul 2022, 07:57

ok, that's good. thanks.

Post Reply