DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=freelaravel
DB_USERNAME=root
DB_PASSWORD=root
php artisan make:migration create_tests_table --create=tests
public function up()
{
Schema::create('tests', function (Blueprint $table) {
$table->id();
$table->timestamps();
// この2つは重要なので絶対消さない
});
}
public function up()
{
Schema::create('tests', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->date('birth');
$table->integer('sei');
$table->timestamps();
});
}
php artisan migrate
php artisan make:model Test
// php artisan make:model 末尾のsを取ったテーブル名
use App\Models\Test;
// use App\Models\モデル作成で入力した名前;