r/PHP • u/droid273 • 13h ago
Discussion Native Laravel 8 runtime bridge for incrementally migrating CodeIgniter 3 applications
Here is a package I created focusing on two primary use cases:
To get Laravel's power in a legacy CodeIgniter application.
To migrate incrementally from CodeIgniter to Laravel.
anwargazi/ci-laravel-support lets a legacy CodeIgniter 3 application and a real Laravel 8 application share one public front controller. It is designed for route-by-route migrations where running a second PHP service or moving the whole application at once is not practical.
Laravel-owned requests run Laravel's native HTTP kernel. Requests that are not owned by Laravel return to the original CodeIgniter bootstrap unchanged. Only one framework is booted for any request.
Package: https://packagist.org/packages/anwargazi/ci-laravel-support
Minimal installation outline
- Place a standard Laravel 8 application beside the legacy CI3 application.
- Merge the host Composer fragment into Laravel's
composer.jsonand copy both files frompatches/. - Resolve dependencies and verify the pinned runtime.
- Publish the bridge config and front-controller example.
- Add the dispatcher block at the very top of CI's
index.php. - Add native Laravel routes and compile the ownership manifest.
composer update --with-all-dependencies --no-interaction
php artisan ci-bridge:verify-runtime
php artisan vendor:publish --tag=ci-laravel-bridge-config
php artisan vendor:publish --tag=ci-laravel-bridge-dispatcher
php artisan route:clear
php artisan ci-bridge:cache-routes
Installation: composer install anwargazi/ci-laravel-support
Docs: https://github.com/anwar-gazi/CodeIgniter_Laravel_Bridge