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

TomJay's avatar

Accessing Spatie Laravel Permission in non-Laravel PHP (Codeigniter?)

Hi there,

We need to provide single sign on across two systems, one in Laravel 5.7 and one (older) CodeIgniter 3. We want to use Spatie Laravel Permission (https://www.github.com/spatie/laravel-permission) in our Laravel system as the authentication library and be able to check the user permissions from within our CI3 application as well.

I think this should be possible if we use DB sessions in our Laravel App, and then include the spatie via composer in our CI app? I'm just getting up to speed with Laravel, so I was hoping someone might have had some experience accessing Laravel functions within CI3, and could point me in the right direction of how to get started?

In the Codeigniter app we need to be able to check if the user is logged in, and check if they have permission for a particular role.

Many thanks

0 likes
2 replies
douglasakula's avatar

Alternatively - you could have a CI Object within your laravel application. The CI object would be an instance of your codeigniter application and the bridge between Laravel and your CI application

TomJay's avatar

@DOUGLASAKULA - Ok cool, but I am not really sure how I would call or reference the Laravel code outside of the laravel framework.

Please or to participate in this conversation.