Blame view

app/Providers/ComposerServiceProvider.php 1.27 KB
242debab8   thesolarwind   Первый коммит в п...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <?php
  
  namespace App\Providers;
  
  use App\Models\Area;
  use App\Models\Contact;
  use App\Models\format_area;
  use App\Models\Tag;
  use App\Models\type_area;
  use Illuminate\Support\ServiceProvider;
  use Illuminate\Support\Facades\View;
  
  class ComposerServiceProvider extends ServiceProvider
  {
      /**
       * Register services.
       *
       * @return void
       */
      public function register()
      {
8634eac35   Андрей Ларионов   Картинки обновлен...
22
          $views = ['part.filter.main','part.filter.catalog', 'part.filter.category', 'part.filter.mapsobj'];
242debab8   thesolarwind   Первый коммит в п...
23
24
25
26
27
28
29
30
31
32
33
34
35
  
          View::composer($views,
              function($view) {
                 $items_type_area = type_area::all();
                 $items_format_area = format_area::all();
                 $items_area = Area::all();
                 $view->with([
                              'items_area' => $items_area,
                              'items_type_area' => $items_type_area,
                              'items_format_area' => $items_format_area,
                     ]);
              }
          );
3646d2a47   Андрей Ларионов   Механизм избранны...
36
          $views = ['layout.site', 'index', 'about'];
242debab8   thesolarwind   Первый коммит в п...
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
          View::composer($views, function($view) {
              $view->with(['items_contact' => Contact::limit(1)->get()]);
          });
  
  
      }
  
      /**
       * Bootstrap services.
       *
       * @return void
       */
      public function boot()
      {
          //
      }
  }