close
step1. 建立專案
composer create-project --prefer-dist laravel/laravel crud "5.2.*"
step2. 設定環境
建立資料庫 crud
crud/.env 調整資料庫相關參數
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= database_name
DB_USERNAME= database_username
DB_PASSWORD= database_password
step3. 建立task Model
透過php artisan 指令建立model
php artisan make:model Task -m
-m意思為 Create a new migration file for the model.
執行完會自動產生migrations檔案
在up()區塊中編輯所需資料表欄位
文章標籤
全站熱搜