diff --git a/routes/api.php b/routes/api.php index 89a0ed7e5..dbfc496ce 100644 --- a/routes/api.php +++ b/routes/api.php @@ -17,9 +17,9 @@ // Global Search... Route::get('/search', '\\'.GlobalSearchController::class); -Route::get('/profile', '\\' . ProfileController::class); -Route::put('/profile', '\\' . ProfileUpdateController::class); -Route::post('/profile/avatar', '\\' . ProfileAvatarController::class); +Route::get('/profile', '\\'.ProfileController::class); +Route::put('/profile', '\\'.ProfileUpdateController::class); +Route::post('/profile/avatar', '\\'.ProfileAvatarController::class); // Filters Route::get('/{repository}/filters', '\\'.RepositoryFilterController::class); diff --git a/src/Http/Requests/ProfileAvatarRequest.php b/src/Http/Requests/ProfileAvatarRequest.php index a2785206d..5d72a981d 100644 --- a/src/Http/Requests/ProfileAvatarRequest.php +++ b/src/Http/Requests/ProfileAvatarRequest.php @@ -25,5 +25,4 @@ public static function usingPath(callable $pathCallback) { static::$pathCallback = $pathCallback; } - } diff --git a/tests/Controllers/ProfileControllerTest.php b/tests/Controllers/ProfileControllerTest.php index 1c012a558..e78a45505 100644 --- a/tests/Controllers/ProfileControllerTest.php +++ b/tests/Controllers/ProfileControllerTest.php @@ -5,7 +5,6 @@ use Binaryk\LaravelRestify\Tests\Fixtures\User\User; use Binaryk\LaravelRestify\Tests\IntegrationTest; use Illuminate\Http\UploadedFile; -use Illuminate\Support\Facades\Storage; class ProfileControllerTest extends IntegrationTest { @@ -24,7 +23,7 @@ public function test_profile_returns_authenticated_user() $response = $this->getJson('/restify-api/profile') ->assertStatus(200) ->assertJsonStructure([ - 'data' + 'data', ]); $response->assertJsonFragment([ @@ -63,7 +62,7 @@ public function test_profile_upload_avatar() $file = UploadedFile::fake()->image($this->getTestJpg())->size(100); $this->postJson('restify-api/profile/avatar', [ - 'avatar' => $file + 'avatar' => $file, ]) ->assertStatus(200); } diff --git a/tests/Fixtures/User/User.php b/tests/Fixtures/User/User.php index 704712ceb..0502674d0 100644 --- a/tests/Fixtures/User/User.php +++ b/tests/Fixtures/User/User.php @@ -36,7 +36,7 @@ class User extends Authenticatable implements Sanctumable, MustVerifyEmail, Rest * @var array */ protected $fillable = [ - 'name', 'email', 'password', 'email_verified_at', 'avatar' + 'name', 'email', 'password', 'email_verified_at', 'avatar', ]; /**