Skip to content

Commit 56170f6

Browse files
Update Field.php
1 parent bf802e8 commit 56170f6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Fields/Field.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ abstract class Field extends FieldElement implements JsonSerializable, Resolvabl
5151
*/
5252
public $attribute;
5353

54+
/**
55+
* Indicates whether the field should be saved on action relation.
56+
*
57+
* @var bool
58+
*/
59+
public $saveOnActionRelation = true;
60+
5461
/**
5562
* The field's resolved value.
5663
*
@@ -387,6 +394,18 @@ public function displayUsing(callable $displayCallback)
387394

388395
return $this;
389396
}
397+
398+
/**
399+
* Prevents the field from being saved when performing an action on a related model.
400+
*
401+
* @return $this
402+
*/
403+
public function doNotSaveOnActionRelation()
404+
{
405+
$this->saveOnActionRelation = false;
406+
407+
return $this;
408+
}
390409

391410
/**
392411
* Define the callback that should be used to resolve the field's value.

0 commit comments

Comments
 (0)