Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Binaryk\LaravelRestify\Http\Middleware\AuthorizeRestify;
use Binaryk\LaravelRestify\Http\Middleware\DispatchRestifyStartingEvent;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostMiddleware;

return [
'auth' => [
Expand Down
1 change: 0 additions & 1 deletion src/Http/Controllers/ProfileAvatarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function __invoke(ProfileAvatarRequest $request)
$user->{$request::$userAvatarAttribute} = $path;
$user->save();


$user->{ProfileAvatarRequest::$userAvatarAttribute} = url($user->{ProfileAvatarRequest::$userAvatarAttribute});

return $this->response()->model($user);
Expand Down
7 changes: 3 additions & 4 deletions src/Http/Requests/InteractWithRepositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Binaryk\LaravelRestify\Restify;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Pipeline\Pipeline;
use Throwable;

/**
* @author Eduard Lupacescu <eduard.lupacescu@binarcode.com>
Expand Down Expand Up @@ -46,7 +45,7 @@ public function repository($key = null): ?Repository
]), 404);
}

if (!$repository::authorizedToUseRepository($this)) {
if (! $repository::authorizedToUseRepository($this)) {
throw new UnauthorizedException(__('Unauthorized to view repository :name. See "allowRestify" policy.', [
'name' => $repository,
]), 403);
Expand Down Expand Up @@ -121,7 +120,7 @@ public function newRepositoryWith($model, $uriKey = null)
*/
public function newQueryWithoutScopes($uriKey = null)
{
if (!$this->isViaRepository()) {
if (! $this->isViaRepository()) {
return $this->model($uriKey)->newQueryWithoutScopes();
}

Expand Down Expand Up @@ -188,7 +187,7 @@ public function viaParentModel()
{
$parent = $this->repository($this->viaRepository);

return once(fn() => $parent::newModel()->newQueryWithoutScopes()->whereKey($this->viaRepositoryId)->firstOrFail());
return once(fn () => $parent::newModel()->newQueryWithoutScopes()->whereKey($this->viaRepositoryId)->firstOrFail());
}

public function viaQuery()
Expand Down
4 changes: 1 addition & 3 deletions tests/Controllers/RepositoryMiddlewaresTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithCustomMiddlewareRepository;
use Binaryk\LaravelRestify\Tests\IntegrationTest;
use Mockery as m;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class RepositoryMiddlewaresTest extends IntegrationTest
{
Expand Down Expand Up @@ -41,7 +40,7 @@ public function test_repository_can_have_custom_middleware()
public function test_request_fails_if_middleware_abort()
{
PostWithCustomMiddlewareRepository::$middlewares = [
PostAbortMiddleware::class
PostAbortMiddleware::class,
];

Restify::repositories([
Expand All @@ -54,7 +53,6 @@ public function test_request_fails_if_middleware_abort()

public function test_foreign_repository_middleware_should_not_be_invoked()
{

$middleware = m::mock(PostAbortMiddleware::class);

$nextParam = null;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/Post/PostWithCustomMiddlewareRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class PostWithCustomMiddlewareRepository extends Repository

public static $uriKey = 'post-with-middleware';


public function fields(RestifyRequest $request)
{
return [
Expand Down
1 change: 0 additions & 1 deletion tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostMergeableRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostUnauthorizedFieldRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithCustomMiddlewareRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithHiddenFieldRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostWithUnauthorizedFieldsRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\User\User;
Expand Down