Skip to content

Confusion about Class Blade Components #590

Answered by bakerkretzmar
nathangross asked this question in Q&A
Discussion options

You must be logged in to vote

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 your composer.json:

"autoload": {
  "psr-4": {
    "Components\\": "app/Components/"
  }
}

and composer dump and you should be all set.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nathangross
Comment options

@bakerkretzmar
Comment options

@nathangross
Comment options

Answer selected by nathangross
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants