Skip to main content

"Back to School" Discount! Only until September 16th: 50% off Yearly/Lifetime membership!

Read more here

Search Results for "view composers"

We found 7 results for "view composers".

Tutorial Free

How to Pass Global Variables to Blade: View Share and Composer

Imagine you want to show some "global" data in the Blade: for example, the number of new users this week on the top navigation. Not sure what Controllers would the data come from? Then you can perform that action in the Service Provider, in three ways.

Code Example Bottelet/DaybydayCRM

Bottelet/DaybydayCRM

Files in the example:

  • app/Http/ViewComposers/ClientHeaderComposer.php
  • app/Providers/ViewComposerServiceProvider.php
  • config/app.php
  • resources/views/clients/show.blade.php
  • resources/views/partials/clientheader.blade.php
Code Example spatie/freek.dev

spatie/freek.dev

Files in the example:

  • app/Http/ViewComposers/LazyViewComposer.php
  • app/Providers/ViewServiceProvider.php
  • resources/views/front/components/lazy.blade.php
Code Example monicahq/monica

monicahq/monica

Files in the example:

  • app/Http/ViewComposers/CurrencySelectViewComposer.php
  • resources/views/partials/components/currency-select.blade.php
Code Example pterodactyl/panel

pterodactyl/panel

Files in the example:

  • app/Providers/ViewComposerServiceProvider.php
  • app/Http/ViewComposers/AssetComposer.php
  • resources/views/templates/wrapper.blade.php
Code Example tighten/onramp

tighten/onramp

Files in the example:

  • app/Providers/ViewServiceProvider.php
  • resources/views/partials/language-switcher.blade.php