@@ -87,7 +87,7 @@ public function show(?Request $request, object $model): bool|Response
8787 /**
8888 * @inheritDoc
8989 */
90- public function update (Request $ request , object $ model ): bool |Response
90+ public function update (? Request $ request , object $ model ): bool |Response
9191 {
9292 if ($ this ->mustAuthorize ()) {
9393 return $ this ->gate ->inspect (
@@ -102,7 +102,7 @@ public function update(Request $request, object $model): bool|Response
102102 /**
103103 * @inheritDoc
104104 */
105- public function destroy (Request $ request , object $ model ): bool |Response
105+ public function destroy (? Request $ request , object $ model ): bool |Response
106106 {
107107 if ($ this ->mustAuthorize ()) {
108108 return $ this ->gate ->inspect (
@@ -117,7 +117,7 @@ public function destroy(Request $request, object $model): bool|Response
117117 /**
118118 * @inheritDoc
119119 */
120- public function showRelated (Request $ request , object $ model , string $ fieldName ): bool |Response
120+ public function showRelated (? Request $ request , object $ model , string $ fieldName ): bool |Response
121121 {
122122 if ($ this ->mustAuthorize ()) {
123123 return $ this ->gate ->inspect (
@@ -132,15 +132,15 @@ public function showRelated(Request $request, object $model, string $fieldName):
132132 /**
133133 * @inheritDoc
134134 */
135- public function showRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
135+ public function showRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
136136 {
137137 return $ this ->showRelated ($ request , $ model , $ fieldName );
138138 }
139139
140140 /**
141141 * @inheritDoc
142142 */
143- public function updateRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
143+ public function updateRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
144144 {
145145 if ($ this ->mustAuthorize ()) {
146146 return $ this ->gate ->inspect (
@@ -155,7 +155,7 @@ public function updateRelationship(Request $request, object $model, string $fiel
155155 /**
156156 * @inheritDoc
157157 */
158- public function attachRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
158+ public function attachRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
159159 {
160160 if ($ this ->mustAuthorize ()) {
161161 return $ this ->gate ->inspect (
@@ -170,7 +170,7 @@ public function attachRelationship(Request $request, object $model, string $fiel
170170 /**
171171 * @inheritDoc
172172 */
173- public function detachRelationship (Request $ request , object $ model , string $ fieldName ): bool |Response
173+ public function detachRelationship (? Request $ request , object $ model , string $ fieldName ): bool |Response
174174 {
175175 if ($ this ->mustAuthorize ()) {
176176 return $ this ->gate ->inspect (
@@ -197,16 +197,16 @@ public function failed(): never
197197 /**
198198 * Create a lazy relation object.
199199 *
200- * @param Request $request
200+ * @param Request|null $request
201201 * @param string $fieldName
202202 * @return LazyRelation
203203 */
204- private function createRelation (Request $ request , string $ fieldName ): LazyRelation
204+ private function createRelation (? Request $ request , string $ fieldName ): LazyRelation
205205 {
206206 return new LazyRelation (
207207 $ this ->service ->server (),
208208 $ this ->schema ()->relationship ($ fieldName ),
209- $ request ->json ()->all ()
209+ $ request? ->json()->all () ?? [],
210210 );
211211 }
212212
0 commit comments