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

lerian's avatar

If true, use directory else return standard page

Hi,

I need to integrate forum (SMF) with my Laravel application and I need to check custom condition for forum access/ It's should looks like this:

if (hasAccessToForum) {
    // use forum directory
} else {
    // return view(...);
}

How can I do this?

0 likes
1 reply
Vilfago's avatar

Use a middleware.

If true, go further with the request, else redirect

Please or to participate in this conversation.