Skip to content

Commit f5b2aa4

Browse files
committed
Merge pull request laravel#1203 from pevawi/patch-1
Update views.md
2 parents 4dbf863 + b4aaae4 commit f5b2aa4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

views.md

+12
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,23 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider
108108

109109
});
110110
}
111+
112+
/**
113+
* Register
114+
*
115+
* @return void
116+
*/
117+
public function register()
118+
{
119+
//
120+
}
111121

112122
}
113123

114124
> **Note:** Laravel does not include a default directory for view composers. You are free to organize them however you wish. For example, you could create an `App\Http\ViewComposers` directory.
115125
126+
Remember to add the service provider in the `config/app.php` configuration file. This file contains a providers array where you can list the names of your service providers.
127+
116128
Now that we have registered the composer, the `ProfileComposer@compose` method will be executed each time the `profile` view is being rendered. So, let's define the composer class:
117129

118130
<?php namespace App\Http\ViewComposers;

0 commit comments

Comments
 (0)