Make class component if project uses Volt Class components #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I appreciate the check that
make:test
provides when you are using a starter kit or already have a Pest or a PHPUnit test created in the project, and I think it makes a great addition to Volt, as well.I always forget to add the
--class
option when creating a new Volt component for my projects.This adds a
usingClass
function to check to see if any Livewire Volt components already exist in theVolt::paths()
and if that is identified as a Class component, then it will default to using the Class component stub when thevolt:make
command is run.Additionally, I did add a
--functional
option to the command due to the fact that there are some folks who might want Class & Functional components to exist in the same project. While that can be written manually, I figured it wouldn't hurt to have an additional option, just in case.