You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Http/Requests/UpdateAssetRequest.php
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -28,23 +28,31 @@ public function authorize()
28
28
*/
29
29
publicfunctionrules()
30
30
{
31
+
$setting = Setting::getSettings();
32
+
31
33
$rules = array_merge(
32
34
parent::rules(),
33
35
(newAsset)->getRules(),
34
-
// this is to overwrite rulesets that include required, and rewrite unique_undeleted
36
+
// This overwrites the rulesets that are set at the model level (via Watson) but are not necessarily required at the request level when doing a PATCH update.
37
+
// Confusingly, this skips the unique_undeleted validator at the model level (and therefore the UniqueUndeletedTrait), so we have to re-add those
38
+
// rules here without the requiredness, since those values will already exist if you're updating an existing asset.
0 commit comments