Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make class component if project uses Volt Class components #106

Merged
merged 3 commits into from
May 31, 2024

Conversation

joshcirre
Copy link
Contributor

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 the Volt::paths() and if that is identified as a Class component, then it will default to using the Class component stub when the volt: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.

@joshcirre joshcirre changed the title Make class component if type already exists Make class component if project uses Volt Class components May 29, 2024
@taylorotwell taylorotwell marked this pull request as draft May 30, 2024 14:21
@joshcirre joshcirre marked this pull request as ready for review May 30, 2024 16:29
@taylorotwell taylorotwell merged commit 72a9bde into livewire:main May 31, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants