• Support
  • Integrating Flarum with Laravel Website

I've been searching for a Laravel based forum for ages, and so happy to have found Flarum!

I was wondering how possible (or difficult) it is to integrate Laravel and Flarum together in terms of sharing user authentication across the site? Also, does Flarum use MySQL or its own version of db?

Could the logged in member access other members-only area in the website? And post comments on blog posts as the registered member?

Thanks so much for your time! 🙂

    niloc I was wondering how possible (or difficult) it is to integrate Laravel and Flarum together in terms of sharing user authentication across the site?

    There are several options. The easiest is to use fof/passport as an extension in Flarum and use Laravel Passport in Laravel. Closer integrations are easy by creating some logic in your Laravel app to do backend to backend calls pre authorizing a user, but this requires a custom Flarum extension to authorize the user. I have done this on occassion and it's quite easy to implement if you have Laravel experience.

    niloc Also, does Flarum use MySQL or its own version of db?

    Flarum runs on MySQL'ish databases.

    niloc Could the logged in member access other members-only area in the website?

    You can set up your permissions as you need. You can also limit certain tags to certain permission groups.

    niloc And post comments on blog posts as the registered member?

    There is an extension that allows a specific tag to act as a blog page. Comments there are similar to Flarum and require permissions or user registration to post.

      luceos There are several options.

      OMG... you can select text and quote specific parts.. this is daaarnn cool!! Wow!!

      Another question, Discourse required cloud based server.. Flarum can be run in typical shared hosting right?

      And thanks so much luceos! 😃

        niloc Flarum can be run in typical shared hosting right?

        Your shared hosting provider should at minimum provide jailed SSH access, the ability for you to download and use Composer, as well as meeting the system requirements mentioned here. In addition, you should also check if the host you chose meets Flarum's server requirements at minimum. Your shared hosting provider should also be flexible with switching to newer PHP versions as older versions reach their end of life and in terms of support.

        I went with NameCheap solely on the fact that they give you Composer out of the box, as I've mentioned previously in a different discussion 🙂

        In hindsight, please let us know if you run into any issue setting up Flarum on the shared hosting provider you eventually decide on using; we are always here to help! 😃

        4 months later

        luceos Closer integrations are easy by creating some logic in your Laravel app to do backend to backend calls pre authorizing a user, but this requires a custom Flarum extension to authorize the user.

        Hi Luceos, I'm still a bit lost with this.. could you elaborate a little more on how to do this?

        Cause I don't want to use SSO, as that isn't so seamless, it will feel as if the forum is a different website from the main site..

          niloc To be honest, some form of SSO is probably going to be your best bet. I wouldn't try to share a users table across applications, as that's chaos.

          What you could do though (with some custom code via an extension) is automatically trigger the SSO process, so its invisible to your users.