PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 12, 2022

[FIXED] How to properly start Laravel 8 with Bootstrap & authentication

 February 12, 2022     laravel, laravel-8, laravel-authentication, laravel-ui, php     No comments   

Issue

I face the following image every time I want to start a new Laravel 8 project with authentication routes set up using the laravel/ui package and Bootstrap scaffolding.

capture

Meaning that the Bootstrap is not yet loading up! Therefore, I have to re-run php artisan UI bootstrap & npm install && npm run dev to correctly set them up.

Here are the steps that I use for creating a new Laravel 8 project:

Install LARAVEL: laravel new [yourprojectname]
Install LARAVEL UI Package: composer require laravel/ui
Generate UI Bootstrap: php artisan ui bootstrap 
Generate Auth Scaffolding: php artisan ui bootstrap --auth
Install NPM Dependencies: npm install && npm run dev
Running LARAVEL: php artisan serve

But now I want to get this thing straight in my head so I won't have to re-run the codes anymore. I mean, what are the correct step-by-step commands for running to have a complete and ready project?


Solution

The steps are correct. For every new Laravel 8.x project that will include Bootstrap and auth scaffolding, you want to run the following.

composer require laravel/ui
php artisan ui bootstrap
php artisan ui bootstrap --auth
npm install && npm run dev

Make a note of the generated /resources/views/layouts/app.blade.php. You will want to include this in all of your views.

@extends('layouts.app')


Answered By - Karl Hill
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing