nadaft / laraspa
Laravel REST API React Scaffolding with Authentication.
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: ^8.0.2
README
LaraSPA
A Laravel package that scaffolds a Laravel REST API and React application. The package implements a REST API for the backend and React for the frontend.
Features
- React
- React Router
- React Redux Toolkit
- React Helmet
- React Toastify
- TailwindCSS, Tailwind Merge and Automatic Class Sorting with Prettier
- Includes Laravel Debugbar and Ide Helper
- Implemented backend API testing
- Includes Login, Register, Reset Password, Resend Email Verification, and Dashboard Pages
- Includes protected routes for authentication
- Optionally you can use ESLint, Prettier and Airbnb Standard. You can choose to use it or not during the installation.
How to install
1. First you need a fresh Laravel installation
If you don't already have one, start by creating a fresh Laravel installation. We recommend starting with a fresh installation because the package will replace your current Laravel application files.
To create a fresh installation, run the following command:
laravel new your-app-name
Once the installation is complete, run the following command:
php artisan migrate
Next, install the necessary node modules using your preferred package manager (npm, yarn, or pnpm):
npm install
or
yarn install
or
pnpm install
2. Install the Package
Run the following command:
composer require nadaft/laraspa --dev
(Optional) If the package isn't discovered automatically, add the service provider to your config/app.php providers array:
Nadaft\Laraspa\LaraspaServiceProvider::class,
3. Install Laraspa
Run the following command:
php artisan laraspa:install
During the installation process, you will be prompted to choose whether or not to use ESLint for your Laravel application. If you choose to use it, the necessary dependencies and configuration files will be installed. If you choose not to use it, the installation will proceed without installing ESLint.
Wait for the installation process to complete. Then, run the following command:
php artisan serve
Your Laravel App is now ready to use.