简体   繁体   中英

Protect laravel routes with amember

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM