diff --git a/src/Http/Requests/InteractWithRepositories.php b/src/Http/Requests/InteractWithRepositories.php index f184ee275..210e4dbe0 100644 --- a/src/Http/Requests/InteractWithRepositories.php +++ b/src/Http/Requests/InteractWithRepositories.php @@ -53,7 +53,7 @@ public function repository($key = null): ?Repository if (! $repository::authorizedToUseRoute($this)) { abort(403, __('Unauthorized to use the route :name. Check prefix.', [ - 'name' => $this->getRequestUri() + 'name' => $this->getRequestUri(), ])); } diff --git a/src/Repositories/WithRoutePrefix.php b/src/Repositories/WithRoutePrefix.php index 7fc13f9ec..959f5b19d 100644 --- a/src/Repositories/WithRoutePrefix.php +++ b/src/Repositories/WithRoutePrefix.php @@ -1,9 +1,7 @@ isForRepositoryRequest()) { // index if (static::indexPrefix()) { - return $request->is(static::indexPrefix() . '/*'); + return $request->is(static::indexPrefix().'/*'); } if (static::prefix()) { - return $request->is(static::prefix() . '/*'); + return $request->is(static::prefix().'/*'); } } else { // the rest - return $request->is(static::prefix() . '/*'); + return $request->is(static::prefix().'/*'); } - } protected static function shouldAuthorizeRouteUsage(): bool @@ -76,6 +73,6 @@ protected static function shouldAuthorizeRouteUsage(): bool return collect([ static::prefix(), static::indexPrefix(), - ])->some(fn($prefix) => (bool) $prefix); + ])->some(fn ($prefix) => (bool) $prefix); } } diff --git a/tests/Repositories/RepositoryCustomPrefixTest.php b/tests/Repositories/RepositoryCustomPrefixTest.php index e50980678..7c337e04b 100644 --- a/tests/Repositories/RepositoryCustomPrefixTest.php +++ b/tests/Repositories/RepositoryCustomPrefixTest.php @@ -2,7 +2,6 @@ namespace Binaryk\LaravelRestify\Tests\Repositories; -use Binaryk\LaravelRestify\Restify; use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository; use Binaryk\LaravelRestify\Tests\IntegrationTest;