From 45337c48016acd7295e02dabd7cf233bd2d24125 Mon Sep 17 00:00:00 2001 From: Cristian Tabacitu Date: Tue, 10 Mar 2020 08:41:40 +0200 Subject: [PATCH] removes a few more laravel helpers --- src/Commands/PivotMigrationMakeCommand.php | 3 ++- src/Migrations/SchemaParser.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Commands/PivotMigrationMakeCommand.php b/src/Commands/PivotMigrationMakeCommand.php index fd86adc..7c0920e 100644 --- a/src/Commands/PivotMigrationMakeCommand.php +++ b/src/Commands/PivotMigrationMakeCommand.php @@ -3,6 +3,7 @@ namespace Laracasts\Generators\Commands; use Illuminate\Console\GeneratorCommand; +use Illuminate\Support\Str; use Symfony\Component\Console\Input\InputArgument; class PivotMigrationMakeCommand extends GeneratorCommand @@ -169,7 +170,7 @@ protected function getSortedTableNames() */ protected function getSortedSingularTableNames() { - $tables = array_map('str_singular', $this->getTableNamesFromInput()); + $tables = array_map('Str::singular', $this->getTableNamesFromInput()); sort($tables); diff --git a/src/Migrations/SchemaParser.php b/src/Migrations/SchemaParser.php index a3edd1f..ee572a2 100644 --- a/src/Migrations/SchemaParser.php +++ b/src/Migrations/SchemaParser.php @@ -143,7 +143,7 @@ private function addForeignConstraint($segments) */ private function getTableNameFromForeignKey($key) { - return str_plural(str_replace('_id', '', $key)); + return Str::plural(str_replace('_id', '', $key)); } /**