Front-end Scaffolding means to create a basic structure for an application. Laravel provides a very simple way to change the front-end presets/scaffolding with any of the other available scaffolding like Bootstrap, Vue and React.
- Step 1: To generate a scaffolding, we first need to install the laravel/ui, which is a composer package and to do that we have to run the following composer command.
composer require laravel/ui --dev
- Step 2: After that, we can run the ui artisan command to generate a base scaffolding. As we discussed before, we can generate the scaffolding for Bootstrap, Vue or React and for that we will run the following artisan command.
php artisan ui bootstrap
php artisan ui vue
php artisan ui react
This will create a components directory in resources/js directory.
- Step 3: After running any of the above preset commands, we will have to install the npm, if it is not installed, to install run the following command.
- Step 4: Now we have to run the following npm command to compile the scaffolding.
npm run dev
Generate Scaffolding with Authentication: Have to complete Generate Scaffolding Step 1 then follow the below steps.
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
This will create components directory in resources/js directory and also creates auth and layouts directory with a home.blade.php file in resources/views directory.
npm run dev
Remove Scaffolding: To remove a generated scaffolding, we will run the following artisan command.
php artisan preset none
Note: This will delete the components directory, which was created but will not delete the file and directory, which were created during the auth scaffolding, in resources/views directory.
- Laravel | Artisan Commands to know in Laravel
- Scaffolding an ExpressJS app from scratch
- Frontend vs Backend
- Angular vs ReactJS : Which one is Most In-Demand Frontend Development Framework in 2019?
- Laravel | Migration Basics
- Laravel | Controller Basics
- Laravel | View Basics
- Laravel | Delete Records
- Differences Between Django vs Laravel
- Laravel | Directory Structure
- Laravel | Validation Rules
- Laravel | Installation and Configuration
- Laravel | Routing Basics
- Laravel | CSRF Protection
- Difference Between Laravel and Ruby on Rails
- Difference Between Laravel and CodeIgniter Framework in PHP
- What are the differences and Similarities Between Lumen and Laravel?
- Laravel | Artisan Console Introduction
- Laravel | Blade Templates Inheritance
- Laravel | Eloquent Model Basics
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.