PHP code example of daniel-de-wit / laravel-mysql-move-column
1. Go to this page and download the library: Download daniel-de-wit/laravel-mysql-move-column 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/ */
daniel-de-wit / laravel-mysql-move-column example snippets
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table): void {
$table->moveColumn('name', 'id');
});
}
};
/*
* Package Service Providers...
*/
DanielDeWit\LaravelMySQLMoveColumnServiceProvider\Providers\LaravelMySQLMoveColumnServiceProvider::class,