PHP code example of nkmryu / laravel-strong-migrations

1. Go to this page and download the library: Download nkmryu/laravel-strong-migrations library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nkmryu / laravel-strong-migrations example snippets




use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Nkmryu\StrongMigrations\SafetyAssured;

return new #[SafetyAssured(reason: 'The application stopped reading this column in the previous release.')] class extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table): void {
            $table->dropColumn('legacy_name');
        });
    }
};
shell
php artisan vendor:publish --tag=strong-migrations-config
shell
php artisan migration:lint
shell
php artisan migration:lint --ci
shell
php artisan migration:lint --json --path=database/migrations --path=packages/example/database/migrations