Quick Tip: Develop Laravel 5 Packages the Laravel 4 Way

By Younes Rafie

Laravel 5 is out, and you may have noticed that the old package development procedure has changed. In this quick tip we will see how we can bring the joy of package development as it was before Laravel 5 to the latest release.

Doing it the Laravel 4 Way

In this part we are going to load and configure the old method to work with Laravel 5. Follow the next steps to get started:

  • Require "illuminate/workbench": "dev-master" in your composer.json.

    // composer.json
    	"require": {
    		"laravel/framework": "5.0.*",
                    "illuminate/workbench": "dev-master"
  • Add "workbench" directory to your autoload > classmap array and run composer update to reflect the changes.

    // composer.json
    	"autoload": {
            "classmap": [
  • Create a workbench.php inside your config folder and define your name and email.

    // config/workbench.php
    	return [
      		"name"    => "John Doe",
      		"email"   => ""
  • add 'Illuminate\Workbench\WorkbenchServiceProvider', to your config/app.php providers.

    // config/app.php
    	"providers" => [

Now you are ready to follow the official Laravel 4 documentation.

Creating packages has always been a part of our application development life cycle, so it makes sense to have a smooth way of doing so. Laravel 4 already had that part covered, and I hope that Laravel 5 will bring the workbench package back into the default installation.


You need the following snippet in bootstrap/autoload.php to make it finally work:

if (is_dir($workbench = __DIR__.'/../workbench'))



Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in PHP, once a week, for free.