AppServiceProvider.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\ServiceProvider;
  4. use App\Http\Controllers\Demo\IndexController;
  5. use Illuminate\View\View;
  6. class AppServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * Bootstrap any application services.
  10. *
  11. * @return void
  12. */
  13. public function boot()
  14. {
  15. //
  16. $d=new IndexController();
  17. $nav=$d->tree();
  18. $foot=$d->foot();
  19. // dd($foot);
  20. // $foot=$foot->toArray();
  21. view()->share('foot',$foot);
  22. view()->share('nav',$nav);
  23. }
  24. /**
  25. * Register any application services.
  26. *
  27. * @return void
  28. */
  29. public function register()
  30. {
  31. //
  32. // 仅在开发环境中使用
  33. if ($this->app->environment() !== 'production') {
  34. $this->app->register(\Way\Generators\GeneratorsServiceProvider::class);
  35. $this->app->register(\Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class);
  36. }
  37. }
  38. }