File tree Expand file tree Collapse file tree 4 files changed +18
-21
lines changed Expand file tree Collapse file tree 4 files changed +18
-21
lines changed Original file line number Diff line number Diff line change 55use Binaryk \LaravelRestify \Http \Requests \ProfileAvatarRequest ;
66use Binaryk \LaravelRestify \Http \Requests \RestifyRequest ;
77use Binaryk \LaravelRestify \Repositories \Repository ;
8- use Binaryk \LaravelRestify \Repositories \UserProfile ;
98use Binaryk \LaravelRestify \Services \Search \RepositorySearchService ;
109
1110class ProfileController extends RepositoryController
@@ -29,7 +28,7 @@ public function __invoke(RestifyRequest $request)
2928 $ meta = [];
3029
3130 if (method_exists ($ user , 'profile ' )) {
32- $ meta = (array )call_user_func ([$ user , 'profile ' ], $ request );
31+ $ meta = (array ) call_user_func ([$ user , 'profile ' ], $ request );
3332 }
3433
3534 return $ this ->response ()
@@ -41,12 +40,12 @@ public function guessRepository(RestifyRequest $request): ?Repository
4140 {
4241 $ repository = $ request ->repository ('users ' );
4342
44- if (!$ repository ) {
43+ if (! $ repository ) {
4544 return null ;
4645 }
4746
4847 if (method_exists ($ repository , 'canUseForProfile ' )) {
49- if (!call_user_func ([$ repository , 'canUseForProfile ' ], $ request )) {
48+ if (! call_user_func ([$ repository , 'canUseForProfile ' ], $ request )) {
5049 return null ;
5150 }
5251 }
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function guessRepository(RestifyRequest $request): ?Repository
4242 }
4343
4444 if (method_exists ($ repository , 'canUseForProfileUpdate ' )) {
45- if (!call_user_func ([$ repository , 'canUseForProfileUpdate ' ], $ request )) {
45+ if (! call_user_func ([$ repository , 'canUseForProfileUpdate ' ], $ request )) {
4646 return null ;
4747 }
4848 }
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ public static function metaProfile(Request $request): array
3434 public function resolveShowMeta ($ request )
3535 {
3636 return [
37- 'authorizedToShow ' => $ this ->authorizedToShow ($ request ),
38- 'authorizedToStore ' => $ this ->authorizedToStore ($ request ),
39- 'authorizedToUpdate ' => $ this ->authorizedToUpdate ($ request ),
40- 'authorizedToDelete ' => $ this ->authorizedToDelete ($ request ),
41- ] + static ::metaProfile ($ request );
37+ 'authorizedToShow ' => $ this ->authorizedToShow ($ request ),
38+ 'authorizedToStore ' => $ this ->authorizedToStore ($ request ),
39+ 'authorizedToUpdate ' => $ this ->authorizedToUpdate ($ request ),
40+ 'authorizedToDelete ' => $ this ->authorizedToDelete ($ request ),
41+ ] + static ::metaProfile ($ request );
4242 }
4343}
Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ public function test_profile_returns_authenticated_user_with_related_posts()
4545 'data ' => [
4646 'posts ' => [
4747 [
48- 'title '
49- ]
50- ]
51- ]
48+ 'title ' ,
49+ ],
50+ ],
51+ ],
5252 ]);
5353 }
5454
@@ -140,7 +140,7 @@ public function test_get_profile_can_use_repository()
140140 ->assertStatus (200 )
141141 ->assertJsonStructure ([
142142 'attributes ' ,
143- 'meta '
143+ 'meta ' ,
144144 ]);
145145
146146 $ response ->assertJsonFragment ([
@@ -159,10 +159,10 @@ public function test_profile_returns_authenticated_user_with_related_posts_via_r
159159 'relationships ' => [
160160 'posts ' => [
161161 [
162- 'attributes '
163- ]
164- ]
165- ]
162+ 'attributes ' ,
163+ ],
164+ ],
165+ ],
166166 ]);
167167
168168 $ response ->assertJsonFragment ([
@@ -203,6 +203,4 @@ public function test_profile_update_via_repository()
203203 'name ' => 'Eduard ' ,
204204 ]);
205205 }
206-
207-
208206}
You can’t perform that action at this time.
0 commit comments