0
1

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系以上でもbootstrapを使いたい!

0
Last updated at Posted at 2021-03-17

【mac】MAMPでLaravelを導入する方法

上の記事ではLaravel6系以上のバージョンを導入していたため、bootstrapが使えませんでした。

こちらの記事では前回の続きとして、Laravel6系以上を導入した環境でbootstrapを使えるようにしたいと思います。

やることは簡単

①まずはプロジェクトフォルダへ移動してください。
※この記事ではプロジェクト(フォルダ)名を「project」としています。

$ cd /applications/mamp/htdocs/project

②以下のコマンドを入力すると残りは簡単です。
下記コードの3.2.0のバージョンは自力で調べてください。
適当な場所で「$ composer require laravel/ui --dev」を実行すれば、コンソールのログで「Using version ~3.2」とか出るはずです。確認が取れたら生成されたフォルダなんかはゴミ箱へポイしてください。
自分の場合はこの方法バージョンを調べて使いました。
荒技(邪道?)なのは承知しているので、スマートな方法を知ってる方は教えてください。

$ composer require laravel/ui "3.2.0" --dev

# 問答無用で最新版を入れる場合は
composer require laravel/ui

③bootstrapを入れてみましょう。

$ php artisan ui bootstrap

④オマケ:vueとreactもついでに入れちゃいましょう

$ php artisan ui vue
$ php artisan ui react

ここまででエラーを吐かれてなければ無事に作業が完了しました!
さあ、お好きなだけBootstrapで遊んでください。

乙したー

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?