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

【初心者向け】Laravelでよく使うコマンドをまとめてみた

Last updated at Posted at 2025-02-11

勉強内容をまとめてました!

初心者だからか、
「あのコマンドってどんな感じで書けばいいんだっけ...」となることが頻繁にあるので、
個人的にまとめてみました。

勉強するたびに更新していく予定です!

コマンド一覧

PHPのバージョンを確認

php -v

Composerのバージョン確認

composer -V
  • composer create-project
    composer(PHPのパッケージ管理ツール)を使って、新しい Laravel プロジェクトを作成するコマンド。
  • laravel/laravel=9.*
    Laravel 9.x の最新バージョンを指定してインストール。

プロジェクト作成

composer create-project "laravel/laravel=9.*" プロジェクト名

現在インストールされている Laravel のバージョンを確認

php artisan -V

モデルとマイグレーションを作成

php artisan make:model モデル名 -m

Eloquent モデル と マイグレーションファイル を同時に作成するためのコマンド

マイグレーションを実行

php artisan migrate

シーダーを作成

php artisan make:seeder シーダー名

シーダーは、ダミーデータや必要になる基礎データなどをまとめて作成することができるもの

シーダーを実行してデータを作成

php artisan db:seed --class=シーダーm
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?