Laravel Support
Laravel | Laravel Vue Make |
---|---|
9, 8 | 2 |
8, 7, 6 | 1 |
Why?
I scaffold files using Artisan a lot. Having a command available to all developers working on a particular codebase helps keep things consistent.
Installation
Install in your Laravel directory via Composer.
cd /path/to/laravel/project
composer require --dev fsac/laravel-vue-make
Usage
Generate a Vue component in the file MyComponent.vue
under resources/js/components
.
php artisan make:vue MyComponent
You may also include subdirectories. The following will create a component in the foo/bar
subdirectory of resources/js/components
.
php artisan make:vue foo/bar/MyComponent
Customise Stubs
Optional. If you'd like to customise the default templates you may publish them to the stubs
directory.
For example you may wish to add a <style>
tag.
php artisan vendor:publish --tag vue-stub