Skip to content

Instantly share code, notes, and snippets.

@evercode1
Last active February 8, 2017 17:35
Show Gist options
  • Select an option

  • Save evercode1/2cb2447684cf3a05da22acb4a5c3b05a to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/2cb2447684cf3a05da22acb4a5c3b05a to your computer and use it in GitHub Desktop.
chapter 13 RocketShipServiceProvider.php
<?php
namespace App\Providers;
use App\Utilities\RocketShip;
use Illuminate\Support\ServiceProvider;
use App\Utilities\Oxygen;
use App\Utilities\FuelTank;
class RocketShipServiceProvider extends ServiceProvider
{
protected $defer = true;
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app
->bind('App\Utilities\Contracts\RocketShipContract',
function(){
return new RocketShip(new FuelTank(), new Oxygen());
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment