Skip to content

Instantly share code, notes, and snippets.

@svpernova09
Created February 9, 2016 18:54
Show Gist options
  • Save svpernova09/97bbcfe487fcd41fa029 to your computer and use it in GitHub Desktop.
Save svpernova09/97bbcfe487fcd41fa029 to your computer and use it in GitHub Desktop.
Using Asterisks for all views in a path?
<?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(
[
'admin',
'admin-projects.*',
],
'App\Http\ViewComposers\ManagingProjectComposer'
);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}
<?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(
[
'admin',
'admin-projects.show',
'admin-projects.create',
'admin-projects.edit',
'admin-projects.index',
],
'App\Http\ViewComposers\ManagingProjectComposer'
);
}
/**
* 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