- Duplicate your
package.json. - Create empty
resources/js/bootstrap.js,resources/sass/app.scssandresources/sass/_variables.scssfiles.
composer require laravel/ui
php artisan ui bootstrap --auth
Type yes for both questions.
Note: This will rewrite home.blade.php and HomeController.php files.
- Remove
resources/js/bootstrap.js,resources/sass/app.scssandresources/sass/_variables.scssfiles. - Remove
package.jsonand copy the duplicated one. - Run
npm installand thennpm run dev. - Open
routes/web.phpand removeRoute::get('/', 'HomeController')->name('home');line. - Open
resources/views/layouts/application.blade.phpand add<meta name="csrf-token" content="{{ csrf_token() }}">line to the<head>block. - Copy with rename
resources/views/layouts/layout-blank.blade.phptoresources/views/layouts/layout-auth.blade.php. - Replace
@extends('layouts.app')with@extends('layouts.layout-auth’)in each view within theresources/views/auth/directory. - Run DB migrations
You can find additional code examples in the resources/views/layouts/app.blade.php file.