ServiceProvider.php 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of ibrand/category.
  4. *
  5. * (c) iBrand <https://www.ibrand.cc>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace iBrand\Component\Category;
  11. use Illuminate\Support\ServiceProvider as LaravelServicePorvider;
  12. class ServiceProvider extends LaravelServicePorvider
  13. {
  14. /**
  15. * Bootstrap the application services.
  16. */
  17. public function boot()
  18. {
  19. if (!class_exists('CreateCategoryTables')) {
  20. $timestamp = date('Y_m_d_His', time());
  21. $this->publishes([
  22. __DIR__ . '/../migrations/create_category_tables.php.stub' =>
  23. database_path() . "/migrations/{$timestamp}_create_category_tables.php",
  24. ], 'migrations');
  25. }
  26. }
  27. /**
  28. * Register the service provider.
  29. */
  30. public function register()
  31. {
  32. $this->app->bind(RepositoryContract::class, Repository::class);
  33. }
  34. }