Sin descripción

IdeHelperServiceProvider.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Laravel IDE Helper Generator
  4. *
  5. * @author Barry vd. Heuvel <barryvdh@gmail.com>
  6. * @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl)
  7. * @license http://www.opensource.org/licenses/mit-license.php MIT
  8. * @link https://github.com/barryvdh/laravel-ide-helper
  9. */
  10. namespace Barryvdh\LaravelIdeHelper;
  11. use Illuminate\Support\ServiceProvider;
  12. use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand;
  13. use Barryvdh\LaravelIdeHelper\Console\Generator2Command;
  14. Use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
  15. class IdeHelperServiceProvider extends ServiceProvider
  16. {
  17. /**
  18. * Indicates if loading of the provider is deferred.
  19. *
  20. * @var bool
  21. */
  22. protected $defer = true;
  23. /**
  24. * Bootstrap the application events.
  25. *
  26. * @return void
  27. */
  28. public function boot()
  29. {
  30. $this->package('barryvdh/laravel-ide-helper', 'laravel-ide-helper', __DIR__);
  31. }
  32. /**
  33. * Register the service provider.
  34. *
  35. * @return void
  36. */
  37. public function register()
  38. {
  39. $this->app['command.ide-helper.generate'] = $this->app->share(
  40. function ($app) {
  41. return new GeneratorCommand($app['config'], $app['files'], $app['view']);
  42. }
  43. );
  44. $this->app['command.ide-helper.models'] = $this->app->share(
  45. function () {
  46. return new ModelsCommand();
  47. }
  48. );
  49. $this->commands('command.ide-helper.generate', 'command.ide-helper.models');
  50. }
  51. /**
  52. * Get the services provided by the provider.
  53. *
  54. * @return array
  55. */
  56. public function provides()
  57. {
  58. return array('command.ide-helper.generate', 'command.ide-helper.models');
  59. }
  60. }