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 5
5
use Binaryk \LaravelRestify \Http \Requests \ProfileAvatarRequest ;
6
6
use Binaryk \LaravelRestify \Http \Requests \RestifyRequest ;
7
7
use Binaryk \LaravelRestify \Repositories \Repository ;
8
- use Binaryk \LaravelRestify \Repositories \UserProfile ;
9
8
use Binaryk \LaravelRestify \Services \Search \RepositorySearchService ;
10
9
11
10
class ProfileController extends RepositoryController
@@ -29,7 +28,7 @@ public function __invoke(RestifyRequest $request)
29
28
$ meta = [];
30
29
31
30
if (method_exists ($ user , 'profile ' )) {
32
- $ meta = (array )call_user_func ([$ user , 'profile ' ], $ request );
31
+ $ meta = (array ) call_user_func ([$ user , 'profile ' ], $ request );
33
32
}
34
33
35
34
return $ this ->response ()
@@ -41,12 +40,12 @@ public function guessRepository(RestifyRequest $request): ?Repository
41
40
{
42
41
$ repository = $ request ->repository ('users ' );
43
42
44
- if (!$ repository ) {
43
+ if (! $ repository ) {
45
44
return null ;
46
45
}
47
46
48
47
if (method_exists ($ repository , 'canUseForProfile ' )) {
49
- if (!call_user_func ([$ repository , 'canUseForProfile ' ], $ request )) {
48
+ if (! call_user_func ([$ repository , 'canUseForProfile ' ], $ request )) {
50
49
return null ;
51
50
}
52
51
}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function guessRepository(RestifyRequest $request): ?Repository
42
42
}
43
43
44
44
if (method_exists ($ repository , 'canUseForProfileUpdate ' )) {
45
- if (!call_user_func ([$ repository , 'canUseForProfileUpdate ' ], $ request )) {
45
+ if (! call_user_func ([$ repository , 'canUseForProfileUpdate ' ], $ request )) {
46
46
return null ;
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ public static function metaProfile(Request $request): array
34
34
public function resolveShowMeta ($ request )
35
35
{
36
36
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 );
42
42
}
43
43
}
Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ public function test_profile_returns_authenticated_user_with_related_posts()
45
45
'data ' => [
46
46
'posts ' => [
47
47
[
48
- 'title '
49
- ]
50
- ]
51
- ]
48
+ 'title ' ,
49
+ ],
50
+ ],
51
+ ],
52
52
]);
53
53
}
54
54
@@ -140,7 +140,7 @@ public function test_get_profile_can_use_repository()
140
140
->assertStatus (200 )
141
141
->assertJsonStructure ([
142
142
'attributes ' ,
143
- 'meta '
143
+ 'meta ' ,
144
144
]);
145
145
146
146
$ response ->assertJsonFragment ([
@@ -159,10 +159,10 @@ public function test_profile_returns_authenticated_user_with_related_posts_via_r
159
159
'relationships ' => [
160
160
'posts ' => [
161
161
[
162
- 'attributes '
163
- ]
164
- ]
165
- ]
162
+ 'attributes ' ,
163
+ ],
164
+ ],
165
+ ],
166
166
]);
167
167
168
168
$ response ->assertJsonFragment ([
@@ -203,6 +203,4 @@ public function test_profile_update_via_repository()
203
203
'name ' => 'Eduard ' ,
204
204
]);
205
205
}
206
-
207
-
208
206
}
You can’t perform that action at this time.
0 commit comments