thetispro / laravel5-setting

Persistent configuration settings for Laravel 5.x with json file(s)
MIT License
26 stars 5 forks source link

Add an Alias mapping to a real class for dependency injection #1

Closed mattzuba closed 9 years ago

mattzuba commented 9 years ago

Something like this in the Service Provider:

$this->app->alias('setting', 'Thetispro\Setting\Setting');

Or change the bind line

$this->app->bind(['setting' => 'Thetispro\Setting\Setting'], function($app) {

Makes it much easier to use dependency injection instead of facades to access everything.

thetispro commented 9 years ago

Done.