Laravel 6 專案建置教學與使用

JungR
JungR
Nov 1 · 2 min read

先確認自己的環境(如:XAMPPWAMP等),PHP版本需7.2以上,Composer已安裝。

示範環境為:

WAMP 3.1.9
— Apache 2.4.39
— PHP 7.2.18
— MySQL 5.7.26

Composer 1.9.0

  • 安裝Laravel 6.0.*
composer create-project laravel/laravel=6.0.* demo --prefer-dist
  • 建立.env檔案
    建立.env之後請將該檔案中之DB相關設定完整(如:DB_DATABASE等)。
cp .env.example .env
  • 使用composer下載相關套件
Composer install
  • 建立laravel key
php artisan key:generate
php artisan cache:clear
php artisan config:clear
  • php artisan migrate 可能會出現的錯誤,可以參考此篇解決

這樣一個Laravel 6 的專案就建置成功囉。

JungR

Written by

JungR

Attitude determines everythings!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade