Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

uccdev's avatar

Authenticate pages using session instead of API?

My Canvas website has different user accounts. I'd like some webpages to be accessible only to accounts with certain qualifiers (e.g only Admin accounts can see page X). What would be the best way to go about this in Laravel?

0 likes
5 replies
bobbybouwmann's avatar

You can use a middleware to do this. So you block users based on their role or a certain status for example.

1 like
bobbybouwmann's avatar

@lacasera is correct. You can create your own custom check and based on that allow or disallow a user into the system ;)

1 like
uccdev's avatar

I see, thank you very much! I'll need to practice this over the next couple of days, but it looks like what I need.

Please or to participate in this conversation.