use Onlinepets\ConditionalMigrations\Contracts\ConditionalMigration;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Carbon;
class DoSomethingVeryIntensive extends Migration implements ConditionalMigration
{
public function up()
{
Schema::table('users', function (Blueprint $table) {
//
});
}
public function down()
{
Schema::table('users', function (Blueprint $table) {
//
});
}
public function shouldRun(): bool
{
return (new Carbon('1 AM'))->lessThan(now())
&& (new Carbon('2 AM'))->greaterThan(now());
}
}