master

laravel/framework

Last updated at: 28/12/2023 01:32

migration.update.stub

TLDR

This file is a stub file for a database migration. It contains a class that extends the Migration class and defines the up and down methods for running and reversing the migrations.

Methods

up

This method is responsible for running the migration. It uses the Schema::table method to make changes to the specified table.

down

This method is responsible for reversing the migration. It uses the Schema::table method to undo the changes made in the up method.

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('{{ table }}', function (Blueprint $table) {
            //
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('{{ table }}', function (Blueprint $table) {
            //
        });
    }
};