1.用composer新增專案
composer create-project laravel/laravel laravelproject2.修改.env設定
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=3.修改 app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot() { Schema::defaultStringLength(191); //這一行新增 }4.修正時區 config/app.php
'timezone' => 'Asia/Taipei',5.建立登入系統
php artisan make:auth6.建立資料表
php artisan make:migration create_users_table
php artisan migrate7.roll back
php artisan migrate:rollback
# 建立 Controller php artisan make:controller PhotoController --resource
php artisan make:controller PhotoController --resource --model=Photo
# 建立 model php artisan make:model User修改欄位 1創建一個修改欄位的class php artisan make:migration change_table_nullable 2class內容 string('column')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // DB::statement('ALTER TABLE job_main MODIFY `outsourcing_company` varchar(191) NOT NULL;'); DB::statement('ALTER TABLE job_main MODIFY `outsourcing_date` varchar(191) NOT NULL;'); } } 3執行artisan migrate php artisan migrate