2023-06-13 21:48:13 +08:00

33 lines
591 B
Plaintext

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('{table}')) { return; }
Schema::{method}('{table}', function (Blueprint $table) {
{content}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('{table}');
}
};