PHPackages                             morrislaptop/laravel-five-package-bridges - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. morrislaptop/laravel-five-package-bridges

ActiveLibrary

morrislaptop/laravel-five-package-bridges
=========================================

Use your Laravel 4 packages in Laravel 5

1.0.3(11y ago)3417.8k9MITPHP

Since Jan 27Pushed 10y ago4 watchersCompare

[ Source](https://github.com/morrislaptop/LaravelFivePackageBridges)[ Packagist](https://packagist.org/packages/morrislaptop/laravel-five-package-bridges)[ RSS](/packages/morrislaptop-laravel-five-package-bridges/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (6)Used By (0)

Laravel Five Package Bridges
============================

[](#laravel-five-package-bridges)

[![Build Status](https://camo.githubusercontent.com/da85295ae969446d9596d45ce6632eb4c30983bab26eaa5b099f4019fdbd2466/68747470733a2f2f7472617669732d63692e6f72672f6d6f727269736c6170746f702f4c61726176656c466976655061636b616765427269646765732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/morrislaptop/LaravelFivePackageBridges)

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

Current packages that are bridged are:

- [laracasts/flash](https://github.com/laracasts/flash)
- [way/generators](https://github.com/JeffreyWay/Laravel-4-Generators)
- [intervention/image](https://github.com/Intervention/image)
- [maatwebsite/excel](https://github.com/Maatwebsite/Laravel-Excel)
- [itsgoingd/clockwork](https://github.com/itsgoingd/clockwork)
- [cartalyst/sentry](https://github.com/cartalyst/sentry)
- [robbiep/cloudconvert-laravel](https://github.com/robbiepaul/cloudconvert-laravel)
- [camroncade/timezone](https://github.com/camroncade/timezone)
- [laracasts/utilities](https://github.com/laracasts/PHP-Vars-To-Js-Transformer)

If you want to build a bridge, please follow the [contributing guide](CONTRIBUTING.md).

Installation
============

[](#installation)

Begin by installing this package through Composer.

```
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..

```
'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..

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

with

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

The final step is to add the bridged service providers instead of the raw service providers.

Open app/config/app.php, and add lines as appropriate.

```
'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.

Custom Packages
===============

[](#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.

```
