From 0d0d4f7e9fcfb92c5c50f0d6e2fc39570392eff1 Mon Sep 17 00:00:00 2001 From: Jason McCreary Date: Wed, 15 Jan 2025 11:33:02 -0500 Subject: [PATCH] Snake case basename --- src/Generators/MigrationGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generators/MigrationGenerator.php b/src/Generators/MigrationGenerator.php index b67e2a34..4aa56a75 100644 --- a/src/Generators/MigrationGenerator.php +++ b/src/Generators/MigrationGenerator.php @@ -276,7 +276,7 @@ protected function buildForeignKey(string $column_name, ?string $on, string $typ } elseif (Str::contains($on, '.')) { [$table, $column] = explode('.', $on); } elseif (Str::contains($on, '\\')) { - $table = Str::lower(Str::plural(Str::afterLast($on, '\\'))); + $table = Str::snake(Str::plural(Str::afterLast($on, '\\'))); $column = Str::afterLast($column_name, '_'); } else { $table = Str::snake(Str::plural($on));