Mirror usage
Modify the global configuration file of composer (recommended)
Open a command line window (windows user) or console (Linux, Mac user) and execute the following commands:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Via Composer Create-Project
You can also install the Laravel application via Composer's create-project command in the terminal :
composer create-project --prefer-dist laravel/laravel blog
JavaScript & CSS scaffolding & user authentication
The Bootstrap and Vue scaffolding code provided by Laravel is located in the laravel / ui dependency package, which needs to be downloaded and installed through Composer:
composer require laravel/ui
After the laravel / ui package is installed, you can use the Artisan command ui to initialize the front-end scaffolding:
//// Generate basic scaffolding ... php artisan ui bootstrap php artisan ui vue php artisan ui react
// Generate login / register bracket ... php artisan ui bootstrap --auth php artisan ui vue --auth php artisan ui react --auth
Laravel does not force you to use specified JavaScript frameworks or libraries to build applications. In fact, you can also use JavaScript completely, but Laravel still introduces some basic scaffolding: using the Vue library makes it easier for us to write modern JavaScript. Vue provides an elegant API that allows us to build powerful JavaScript applications through components. Like CSS, we can use Laravel Mix to easily compile multiple JavaScript components into a single JavaScript file.
Install front-end dependencies and compile front-end resources
npm install && npm run dev
Finally, run a database migration to generate user tables
php artisan migrate
At this point, the fully functional user registration and login function has been completed. Visit http: //your-app.test/register in the browser to see the user registration interface.