I am using laravel for my web application. I have integrated amember within my larvel site inside /publi/amember
. Now i want to protect my routes using amember. Anyone knows how to do it. I am using L5 Moduler
structure for my larvel site.
Asked
Active
Viewed 378 times
0

RAUSHAN KUMAR
- 5,846
- 4
- 34
- 70
-
from what i seen in the tag AMember is used as a wordpress plugin – madalinivascu Nov 24 '17 at 06:56
-
@madalinivascu said, i searched on google and it displays results related to wordpress plugin! You are right madalinivascu! – Hiren Gohel Nov 24 '17 at 06:57
-
how did you integrate AMember in laravel exactly ? – madalinivascu Nov 24 '17 at 06:59
-
@madalinivascu i just placed the amember files inside public and point this to my route `http://example.com/amember` – RAUSHAN KUMAR Nov 24 '17 at 07:13
-
@RAUSHANKUMAR let's assume that what you did is called "integration" why do you want to protect the laravel routes?how?from who? – madalinivascu Nov 24 '17 at 07:20
-
@madalinivascu actually we have different types of subscription, and for each type of subscription we have different pages and functionality. So i want to need that – RAUSHAN KUMAR Nov 24 '17 at 07:48
-
what does subscriptions have to do with laravel routes? – madalinivascu Nov 24 '17 at 07:50
-
@madalinivascu actually subscriptions means to the user plans that he purchased – RAUSHAN KUMAR Nov 24 '17 at 07:53
-
what does subscriptions have to do with laravel routes? – madalinivascu Nov 24 '17 at 08:29
1 Answers
1
The best approach is use Am_Lite API to do it. http://www.amember.com/docs/API/Lite
So you need to include this file amember/library/Am/Lite.php within your application (before any output done) and then use the following call to check access:
Am_Lite::getInstance()->checkAccess(Am_Lite::PAID);
In event of user has necessary access then this call do nothing otherwise redirect user to login form.

Andrey Yerokhin
- 273
- 1
- 7