Created
February 12, 2017 09:56
-
-
Save samundra/901cd62fa98f0673b1cbbeec2ec17c3b to your computer and use it in GitHub Desktop.
Provides the "make:seeder" command in Lumen5.3.*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filename: App/Providers/MakeSeedServiceProvider.php | |
*/ | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Database\Console\Seeds\SeederMakeCommand; | |
class MakeSeedServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Indicates if loading of the provider is deferred. | |
* | |
* @var bool | |
*/ | |
protected $defer = true; | |
/** | |
* Register the service provider. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
$this->registerMakeSeedCommand(); | |
$this->commands('command.seed.make'); | |
} | |
/** | |
* Register the seed console command. | |
* | |
* @return void | |
*/ | |
protected function registerMakeSeedCommand() | |
{ | |
$this->app->singleton('command.seed.make', function ($app) { | |
return new SeederMakeCommand($app['files'], $app['composer']); | |
}); | |
} | |
/** | |
* Get the services provided by the provider. | |
* | |
* @return array | |
*/ | |
public function provides() | |
{ | |
return ['command.seed.make']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment