1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel6.20でログイン認証機能をつけようとしたら失敗したので、まとめた

Posted at

Laravel 6.20でログイン認証機能をつける際に、Laravel 5.8と実装方法が違ったので学習記録としてまとめます。

環境

  • Laravel 6.20.27
  • Composer 2.0.12
  • npm 7.13.0

エラー

  • 認証機能を下記のコマンドで実装しようとした
php artisan make:auth
  • しかし、エラーが発生して実装できず
 Command "make:auth" is not defined.
  • その後に、別のコマンドを試してみた
composer require laravel/ui
  • しかし、こちらもエラーでどうにもならず
Problem 1
    - laravel/ui[v3.3.0, ..., 3.x-dev] require illuminate/console ^8.42 -> found illuminate/console[v8.42.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires laravel/ui ^3.3 -> satisfiable by laravel/ui[v3.3.0, 3.x-dev].

なぜエラーが出たのか

  • Laravel 6.0 以降ではサポートしていないコマンドだった
php artisan make:auth
  • LaravelとLaravel/uiのバージョンが合っていない
composer require laravel/ui

上記を考慮したログイン認証機能の実装手順

  • Laravel 6系まではlaravel/ui 1.*にバージョンを指定する必要がある(※Laravel 7系は laravel/ui 2.*にする)ので、下記のコマンドを順番に入力する。
composer require laravel/ui 1.*
php artisan ui vue --auth
npm install
npm run dev
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?