Skip to content

Instantly share code, notes, and snippets.

View hrsa's full-sized avatar

Anton Cherednichenko hrsa

View GitHub Profile
@hrsa
hrsa / 2018_02_07_101510_migrate_to_utf8mb4.php
Last active February 20, 2024 20:43 — forked from NBZ4live/2018_02_07_101510_migrate_to_utf8mb4.php
Laravel migration to migrate the database from utf8 to utf8mb4 (exclude views and char() columns and keep default values)
<?php
use Illuminate\Database\Migrations\Migration;
return new class extends Migration {
public function up(): void
{
$this->migrateCharsetTo('utf8mb4', 'utf8mb4_unicode_ci');
}