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?

Laravel12 インストール

Posted at
install.sh
composer create-project laravel/laravel:^12.0 プロジェクト名

node package をインストール

npm install

次にenvファイルを設定データベースをデフォルトから変更
よく使うしmysqlで

#デフォルトは下記
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

#修正する 環境にあった設定をしてください
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE={データベース名を入力}
DB_USERNAME={usernameを入力}
DB_PASSWORD={passwordを入力}

念の為。.envを変更したので

php artisan config:clear
php artisan cache:clear

artisanでデータベースマイグレーション

php artisan migrate

dev環境開発を進めるホットリロード開始

npm run dev

ちなみにこれだけだとviteサーバーが立ち上がっただけ(環境にもよる)
あとは別途webサーバーでlaravelが動作する環境のURLでアクセス
dockerなら特に設定なしでアクセスできる

ちなみにディレクトリのpublicがルートディレクトリに設定されていること

sassの準備 flocss

sassインストールしていなかったら

-D(--save-dev)は開発用依存としてpackage.jsonに追加するオプションです

npm install -D sass

sass-embedded は、Dart Sassの「埋め込み版」で、Node.jsから高速にSassをコンパイルできます。

npm install -D sass-embedded
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?