Created
July 13, 2015 22:00
-
-
Save sunnysingh/bb442b2b16a34ac2888c to your computer and use it in GitHub Desktop.
Revisions
-
sunnysingh created this gist
Jul 13, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ <?php namespace App\Http\ViewComposers; use Illuminate\Contracts\View\View; use Auth; class AppComposer { /** * Create a new app composer. */ public function __construct() { // } /** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with([ 'user' => Auth::user(), ]); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <?php namespace App\Providers; use View; use Illuminate\Support\ServiceProvider; class ComposerServiceProvider extends ServiceProvider { /** * Register bindings in the container. * * @return void */ public function boot() { // App composer View::composer([ 'settings.*', // add your templates here that extend app ], 'App\Http\ViewComposers\AppComposer'); } /** * Register * * @return void */ public function register() { // } }