2017 © Pedro Peláez
 

library laravel-five-package-bridges

Use your Laravel 4 packages in Laravel 5

image

morrislaptop/laravel-five-package-bridges

Use your Laravel 4 packages in Laravel 5

  • Wednesday, January 13, 2016
  • by morrislaptop
  • Repository
  • 4 Watchers
  • 34 Stars
  • 14,354 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

Laravel Five Package Bridges

Build Status, (*1)

This Laravel package provides a bridging trait and multiple bridges that allows Laravel 4 packages to be used in Laravel 5., (*2)

Current packages that are bridged are:, (*3)

If you want to build a bridge, please follow the contributing guide., (*4)

Installation

Begin by installing this package through Composer., (*5)

composer require morrislaptop/laravel-five-package-bridges

Once this operation completes, add the config service provider, this brings the package() method back to the config repository. Open app/config/app.php and add.., (*6)

'Morrislaptop\LaravelFivePackageBridges\ConfigServiceProvider',

Then we need to swap the core Application class with the bridging, this adds various methods like after() back. Open bootstrap/app.php and replace.., (*7)

$app = new Illuminate\Foundation\Application(
    realpath(__DIR__.'/../')
);

with, (*8)

$app = new Morrislaptop\LaravelFivePackageBridges\Application(
    realpath(__DIR__.'/../')
);

The final step is to add the bridged service providers instead of the raw service providers., (*9)

Open app/config/app.php, and add lines as appropriate., (*10)

'Morrislaptop\LaravelFivePackageBridges\Bridges\FlashServiceProvider',

'Morrislaptop\LaravelFivePackageBridges\Bridges\GeneratorsServiceProvider',
'Morrislaptop\LaravelFivePackageBridges\Bridges\ImageServiceProvider',
'Morrislaptop\LaravelFivePackageBridges\Bridges\ExcelServiceProvider',
'Morrislaptop\LaravelFivePackageBridges\Bridges\ClockworkServiceProvider',
'Morrislaptop\LaravelFivePackageBridges\Bridges\SentryServiceProvider',

Voila! Those packages now work as they always did in Laravel 4., (*11)

Custom Packages

If you have a private package you can simply create your own bridging service provider and bring in the trait from this package., (*12)

<?php namespace App\Bridges;



use Morrislaptop\LaravelFivePackageBridges\LaravelFivePackageBridgeTrait;

use Acme\Private\NuclearServiceProvider as BaseNuclearServiceProvider;



class NuclearServiceProvider extends BaseNuclearServiceProvider 
{


    use LaravelFivePackageBridgeTrait;


}

Contributing

Please see the contributing guide., (*13)

The Versions