Skip to content

Instantly share code, notes, and snippets.

@Mombuyish
Last active February 16, 2017 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mombuyish/7e1f384be742d3c2d8068410ee34bedd to your computer and use it in GitHub Desktop.
Save Mombuyish/7e1f384be742d3c2d8068410ee34bedd to your computer and use it in GitHub Desktop.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class ComposerServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Using Closure based composers...
// Here is a simple example...
View::composer('collections.index', \App\Http\ViewComposers\AllPostComposer::class);
}
/**
* 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