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 2024-10-22

はじめに

以下はLaravelで使用できるコマンドの備忘録です

随時更新します

プロジェクトを新規作成する

Laravelの新規プロジェクトを作成するコマンドですが、コマンドの実行にはcomposerのインストールが必要です

project-name は、作成するプロジェクトの名前に置き換えてください

例:customer-management , user_profile_app など

composer create-project --prefer-dist laravel/laravel project-name

Laravelサーバーを起動する

php artisan serve

コントローラーを作成する

Laravelでコントローラーを作成するArtisanコマンドです
ControllerName は作成したいコントローラーの名前に置き換えます

例:CustomerController など

php artisan make:controller ControllerName

追加オプションについて

リソースコントローラーを作成する場合は--resource オプションを追加します。
CRUD操作に必要なメソッド(index, create, store, show, edit, update, destroy)が自動的に生成されます。

php artisan make:controller ControllerName --resource

マイグレーションを実行する

テーブルを実装するマイグレーションを実行できます

Laravelとデータベースの接続確認にも利用できます

php artisan migrate
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?