You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: views.md
+12
Original file line number
Diff line number
Diff line change
@@ -108,11 +108,23 @@ Let's organize our view composers within a [service provider](/docs/5.0/provider
108
108
109
109
});
110
110
}
111
+
112
+
/**
113
+
* Register
114
+
*
115
+
* @return void
116
+
*/
117
+
public function register()
118
+
{
119
+
//
120
+
}
111
121
112
122
}
113
123
114
124
> **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.
115
125
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
+
116
128
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:
0 commit comments