Laravel React Make
Create React function and class components using Artisan. Laravel 8, 7 and 6.
Installation
In your Laravel directory install via Composer.
composer require --dev fsac/laravel-react-make
Usage
Generate a React function component in the file MyComponent.js
under resources/js/components
.
% php artisan make:react MyComponent
You may also include subdirectories. The following will create a component in the foo/bar
subdirectory of resources/js/components
.
% php artisan make:react foo/bar/MyComponent
Use .jsx
file extension instead of the default .js
. The short version -x
may also be used.
% php artisan make:react --jsx MyComponent
Generate a React class component. The short version -c
may also be used.
% php artisan make:react --class MyComponent
Customise Stubs
Optional. If you'd like to customise the default templates you may publish them to the stubs
directory.
% php artisan vendor:publish --tag react-stub
License
Laravel React Make is open-sourced software licensed under the MIT license.