Skip to content

Instantly share code, notes, and snippets.

@ChadTaljaardt
Created April 26, 2016 23:27
Show Gist options
  • Save ChadTaljaardt/89621aa3b3788f1f9b0828502ae436c5 to your computer and use it in GitHub Desktop.
Save ChadTaljaardt/89621aa3b3788f1f9b0828502ae436c5 to your computer and use it in GitHub Desktop.
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ComposerServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Using class based composers...
view()->composer(
'frontend.includes.header', 'App\Http\ViewComposers\HeaderComposer'
);
view()->composer(
'frontend.pages.products', 'App\Http\ViewComposers\ProductsComposer'
);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment