DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Santhosh
Santhosh

Posted on • Updated on

Laravel 6 and Make Auth

Laravel 6 came with a hero's welcome this Tuesday. When I started to try to see how the new one is, I was straight away hit at a wall.

php artisan make:auth

Make Auth command is not anymore available in Laravel 6. But, don't worry. we are covered with a better solution for this.

New package - Laravel UI
Laravel has come up with a new package - Laravel UI which separates UI part of an application apart. This could help developers to create a server only applicaiton (API host) or a Console only application, without having the extra burden of UI attached to it.

Laravel UI can be installed with composer command:

composer create-project laravel/laravel blog
cd blog
composer require laravel/ui

Once this package is installed successfully, it gives a few new artisan commands.

➜ php artisan ui --help
Description:
  Swap the front-end scaffolding for the application

Usage:
  ui [options] [--] <type>

Arguments:
  type                   The preset type (bootstrap, vue, react)

Options:
      --auth             Install authentication UI scaffolding
      --option[=OPTION]  Pass an option to the preset command (multiple values allowed)
  -h, --help             Display this help message
  -q, --quiet            Do not output any message
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --env[=ENV]        The environment the command should run under
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

UI can be initiated with either VueJS or with React.

php artisan ui vue 
php artisan ui react

For creating authentication scaffolds, add --auth to the ui command.

php artisan ui:auth
php artisan ui:auth --views

Running the first command sets up the routes and scaffolds for authentication and second one sets up the views.

Fun time's up! Let us get back to work...!

Top comments (2)

Collapse
 
kalecio profile image
KalΓ©cio

Kinda related question, which framework works the best with php/laravel?
I've seen a lot of tutorials about laravel with people using Vue instead of React, why this preference? Is it easier to use Vue with php? Are there any advantages?

Collapse
 
santhoshj profile image
Santhosh

Though it is purely an opinionated decision; I would definitely advocate for Vue.js. Because, I found Vue is much simpler and lighter compared to React.

Also, Vue has the best features out of Angular and React. Moreover, React is from Facebook, which is a good reason for me to ditch it. :)

Make Your Github Profile Stand Out

Github is great, but have you considered how to make yours more attractive for potential employers or other visitors? Even non-tech ones like recruiters!

Take a couple of hours and show your best side as a person - and a programmer.