diff --git a/.travis.yml b/.travis.yml index 35c5d69..3136004 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,15 @@ php: - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 + - 8.0 - nightly matrix: allow_failures: - php: nightly + - php: 8.0 before_script: - composer self-update diff --git a/composer.json b/composer.json index 7d15cc6..943605e 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,7 @@ ], "require": { "php": ">=5.4.0", - "illuminate/support": "~5.0|~6.0", - "laravel/helpers": "^1.1" + "illuminate/support": "~5.0|~6.0|~7.0" }, "require-dev": { "phpspec/phpspec": "~2.1" diff --git a/src/Commands/MigrationMakeCommand.php b/src/Commands/MigrationMakeCommand.php index 800d1e5..195837b 100644 --- a/src/Commands/MigrationMakeCommand.php +++ b/src/Commands/MigrationMakeCommand.php @@ -5,6 +5,7 @@ use Illuminate\Console\Command; use Illuminate\Container\Container; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Str; use Laracasts\Generators\Migrations\NameParser; use Laracasts\Generators\Migrations\SchemaParser; use Laracasts\Generators\Migrations\SyntaxBuilder; @@ -189,7 +190,7 @@ protected function compileMigrationStub() */ protected function replaceClassName(&$stub) { - $className = ucwords(camel_case($this->argument('name'))); + $className = ucwords(Str::camel($this->argument('name'))); $stub = str_replace('{{class}}', $className, $stub); @@ -237,7 +238,7 @@ protected function replaceSchema(&$stub) */ protected function getModelName() { - return ucwords(str_singular(camel_case($this->meta['table']))); + return ucwords(Str::singular(Str::camel($this->meta['table']))); } /** diff --git a/src/Migrations/SchemaParser.php b/src/Migrations/SchemaParser.php index aa8a600..a3edd1f 100644 --- a/src/Migrations/SchemaParser.php +++ b/src/Migrations/SchemaParser.php @@ -2,6 +2,8 @@ namespace Laracasts\Generators\Migrations; +use Illuminate\Support\Str; + class SchemaParser { /** @@ -104,7 +106,7 @@ private function parseOptions($options) if (empty($options)) return []; foreach ($options as $option) { - if (str_contains($option, '(')) { + if (Str::contains($option, '(')) { preg_match('/([a-z]+)\(([^\)]+)\)/i', $option, $matches); $results[$matches[1]] = $matches[2];