Confusion about Class Blade Components #590
-
Hopefully this is a quick one: where would I put this
I too am trying to utilize blade components for my layout files and hoping to not have to pass the $page var each time. I came across #492 and #541 but I wasn't exactly sure where that php file should go. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can actually put the PHP files wherever you want as long as you namespace and autoload them properly. Jigsaw will discover any components that are in the global If you put them in "autoload": {
"psr-4": {
"Components\\": "app/Components/"
}
} and |
Beta Was this translation helpful? Give feedback.
You can actually put the PHP files wherever you want as long as you namespace and autoload them properly. Jigsaw will discover any components that are in the global
Components\
namespace, so just autoload the directory that your component's PHP files are in. See #507.If you put them in
app/Components
for example, add this to yourcomposer.json
:and
composer dump
and you should be all set.