0
0

More than 3 years have passed since last update.

Laravel 7.4で認証関連機能を認証を含むアプリケーションを構築する方法

Last updated at Posted at 2020-04-18

参照

  • 公式マニュアル

  • Laravelは古いバージョンの時代から認証関連機能を容易に構築できたが、最近のバージョンではもっと簡単になっているらしい。

    Tip!! さくっと始めたいですか? 
    真新しくインストールしたLaravelアプリケーションにlaravel/ui Composerパッケージをインストールし、php artisan ui vue --authを実行してください。
    データベースをマイグレーションし、http://your-app.test/registerかアプリケーションに割り付けた別のURLをブラウザでアクセスしましょう。
    これらのコマンドが、認証システム全体のスカフォールドの面倒を見ます。
    
  • マニュアルの頭にこう書いてあるものの、もう少し読んでいくと、プロジェクト作成時にオプションを指定するだけで良いことがわかる。

アプリケーションの作成

  • laravelコマンドを使って新規アプリケーションを生成する際に、--authディレクティブを使用する。

    laravel new your-project-name --auth
    
    (実行結果)
    Crafting application...
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Package operations: 93 installs, 0 updates, 0 removals
      - Installing doctrine/inflector (1.3.1): Loading from cache
      - Installing doctrine/lexer (1.2.0): Loading from cache
    
      ...
    
    Package manifest generated successfully.
    Application ready! Build something amazing.
    
    • 以上。まさにamazing!!

確認

0
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
0
0