@@ -87,7 +87,7 @@ public function show(?Request $request, object $model): bool|Response
87
87
/**
88
88
* @inheritDoc
89
89
*/
90
- public function update (Request $ request , object $ model ): bool |Response
90
+ public function update (? Request $ request , object $ model ): bool |Response
91
91
{
92
92
if ($ this ->mustAuthorize ()) {
93
93
return $ this ->gate ->inspect (
@@ -102,7 +102,7 @@ public function update(Request $request, object $model): bool|Response
102
102
/**
103
103
* @inheritDoc
104
104
*/
105
- public function destroy (Request $ request , object $ model ): bool |Response
105
+ public function destroy (? Request $ request , object $ model ): bool |Response
106
106
{
107
107
if ($ this ->mustAuthorize ()) {
108
108
return $ this ->gate ->inspect (
@@ -117,7 +117,7 @@ public function destroy(Request $request, object $model): bool|Response
117
117
/**
118
118
* @inheritDoc
119
119
*/
120
- public function showRelated (Request $ request , object $ model , string $ fieldName ): bool |Response
120
+ public function showRelated (? Request $ request , object $ model , string $ fieldName ): bool |Response
121
121
{
122
122
if ($ this ->mustAuthorize ()) {
123
123
return $ this ->gate ->inspect (
@@ -132,15 +132,15 @@ public function showRelated(Request $request, object $model, string $fieldName):
132
132
/**
133
133
* @inheritDoc
134
134
*/
135
- public function showRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
135
+ public function showRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
136
136
{
137
137
return $ this ->showRelated ($ request , $ model , $ fieldName );
138
138
}
139
139
140
140
/**
141
141
* @inheritDoc
142
142
*/
143
- public function updateRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
143
+ public function updateRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
144
144
{
145
145
if ($ this ->mustAuthorize ()) {
146
146
return $ this ->gate ->inspect (
@@ -155,7 +155,7 @@ public function updateRelationship(Request $request, object $model, string $fiel
155
155
/**
156
156
* @inheritDoc
157
157
*/
158
- public function attachRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
158
+ public function attachRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
159
159
{
160
160
if ($ this ->mustAuthorize ()) {
161
161
return $ this ->gate ->inspect (
@@ -170,7 +170,7 @@ public function attachRelationship(Request $request, object $model, string $fiel
170
170
/**
171
171
* @inheritDoc
172
172
*/
173
- public function detachRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
173
+ public function detachRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
174
174
{
175
175
if ($ this ->mustAuthorize ()) {
176
176
return $ this ->gate ->inspect (
@@ -197,16 +197,16 @@ public function failed(): never
197
197
/**
198
198
* Create a lazy relation object.
199
199
*
200
- * @param Request $request
200
+ * @param Request|null $request
201
201
* @param string $fieldName
202
202
* @return LazyRelation
203
203
*/
204
- private function createRelation (Request $ request , string $ fieldName ): LazyRelation
204
+ private function createRelation (? Request $ request , string $ fieldName ): LazyRelation
205
205
{
206
206
return new LazyRelation (
207
207
$ this ->service ->server (),
208
208
$ this ->schema ()->relationship ($ fieldName ),
209
- $ request ->json ()->all ()
209
+ $ request? ->json()->all () ?? [],
210
210
);
211
211
}
212
212
0 commit comments