Skip to content

Commit f50326c

Browse files
committed
fixed str issue for laravel 6
1 parent b9e8678 commit f50326c

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/Console/Commands/MakeMultiAuthCommand.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bitfumes\Multiauth\Console\Commands;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Console\Command;
67
use Illuminate\Container\Container;
78

@@ -96,7 +97,7 @@ protected function addGuard()
9697
protected function checkGuard()
9798
{
9899
$providers = array_keys(config('auth.providers'));
99-
$name = str_plural($this->name);
100+
$name = Str::plural($this->name);
100101

101102
return in_array($name, $providers);
102103
}
@@ -350,14 +351,14 @@ protected function parseName($name = null)
350351
}
351352

352353
return [
353-
'{{pluralCamel}}' => str_plural(camel_case($name)),
354-
'{{pluralSlug}}' => str_plural(str_slug($name)),
355-
'{{pluralSnake}}' => str_plural(snake_case($name)),
356-
'{{pluralClass}}' => str_plural(studly_case($name)),
357-
'{{singularCamel}}' => str_singular(camel_case($name)),
358-
'{{singularSlug}}' => str_singular(str_slug($name)),
359-
'{{singularSnake}}' => str_singular(snake_case($name)),
360-
'{{singularClass}}' => str_singular(studly_case($name)),
354+
'{{pluralCamel}}' => Str::plural(camel_case($name)),
355+
'{{pluralSlug}}' => Str::plural(Str::slug($name)),
356+
'{{pluralSnake}}' => Str::plural(snake_case($name)),
357+
'{{pluralClass}}' => Str::plural(studly_case($name)),
358+
'{{singularCamel}}' => Str::singular(camel_case($name)),
359+
'{{singularSlug}}' => Str::singular(Str::slug($name)),
360+
'{{singularSnake}}' => Str::singular(snake_case($name)),
361+
'{{singularClass}}' => Str::singular(studly_case($name)),
361362
'{{namespace}}' => $this->getNamespace(),
362363
];
363364
}

src/Console/Commands/RollbackMultiAuthCommand.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Bitfumes\Multiauth\Console\Commands;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Console\Command;
67
use Illuminate\Container\Container;
78

@@ -166,7 +167,7 @@ protected function removeMigration()
166167
$migration_path = database_path('migrations');
167168
$files = glob("{$migration_path}/*.php");
168169
foreach ($files as $file) {
169-
if (str_contains($file, "create_{$guard}_table")) {
170+
if (Str::contains($file, "create_{$guard}_table")) {
170171
unlink($file);
171172
}
172173
}
@@ -244,14 +245,14 @@ protected function parseName($name = null)
244245
}
245246

246247
return [
247-
'{{pluralCamel}}' => str_plural(camel_case($name)),
248-
'{{pluralSlug}}' => str_plural(str_slug($name)),
249-
'{{pluralSnake}}' => str_plural(snake_case($name)),
250-
'{{pluralClass}}' => str_plural(studly_case($name)),
251-
'{{singularCamel}}' => str_singular(camel_case($name)),
252-
'{{singularSlug}}' => str_singular(str_slug($name)),
253-
'{{singularSnake}}' => str_singular(snake_case($name)),
254-
'{{singularClass}}' => str_singular(studly_case($name)),
248+
'{{pluralCamel}}' => Str::plural(camel_case($name)),
249+
'{{pluralSlug}}' => Str::plural(Str::slug($name)),
250+
'{{pluralSnake}}' => Str::plural(snake_case($name)),
251+
'{{pluralClass}}' => Str::plural(studly_case($name)),
252+
'{{singularCamel}}' => Str::singular(camel_case($name)),
253+
'{{singularSlug}}' => Str::singular(Str::slug($name)),
254+
'{{singularSnake}}' => Str::singular(snake_case($name)),
255+
'{{singularClass}}' => Str::singular(studly_case($name)),
255256
'{{namespace}}' => $this->getNamespace(),
256257
];
257258
}

0 commit comments

Comments
 (0)