diff --git a/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php b/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php index 13d3d9cd1ae4..7a13d37cfa67 100644 --- a/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php +++ b/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php @@ -2,6 +2,7 @@ namespace Illuminate\Foundation\Auth\Access; +use Illuminate\Support\Str; use Illuminate\Contracts\Auth\Access\Gate; trait AuthorizesRequests @@ -81,7 +82,7 @@ protected function normalizeGuessedAbilityName($ability) */ public function authorizeResource($model, $parameter = null, array $options = [], $request = null) { - $parameter = $parameter ?: snake_case(lcfirst(class_basename($model))); + $parameter = $parameter ?: Str::snake(lcfirst(class_basename($model))); $middleware = []; diff --git a/src/Illuminate/Foundation/Console/TestMakeCommand.php b/src/Illuminate/Foundation/Console/TestMakeCommand.php index 3c63323043fc..15b8cdf85368 100644 --- a/src/Illuminate/Foundation/Console/TestMakeCommand.php +++ b/src/Illuminate/Foundation/Console/TestMakeCommand.php @@ -2,6 +2,7 @@ namespace Illuminate\Foundation\Console; +use Illuminate\Support\Str; use Illuminate\Console\GeneratorCommand; class TestMakeCommand extends GeneratorCommand @@ -49,7 +50,7 @@ protected function getStub() */ protected function getPath($name) { - $name = str_replace_first($this->rootNamespace(), '', $name); + $name = Str::replaceFirst($this->rootNamespace(), '', $name); return $this->laravel->basePath().'/tests'.str_replace('\\', '/', $name).'.php'; } diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 496bcdff9864..9589a1f63de6 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -1,5 +1,6 @@ resource->toArray(), $attributes) + Arr::only($this->resource->toArray(), $attributes) ); }