will it work in the hasOne relationship? #796
Answered
by
Gummibeer
singleseeker
asked this question in
Q&A
-
class Plan extends Model
{
use LogsActivity;
// protected static $logFillable = true;
protected static $logOnlyDirty = true;
protected static $logName = 'plan';
// ??? HERE, if proposal.status changed , it will log automatically
protected static $logAttributes = ['proposal.status'];
protected $fillable = [
'title', 'short_description', 'description', 'budget', 'budget_type', 'working_hours', 'cat_id', 'user_id',
];
public function proposal()
{
return $this->hasOne( Proposal::class , 'plan_id' );
}
} Thank you . |
Beta Was this translation helpful? Give feedback.
Answered by
Gummibeer
Sep 29, 2020
Replies: 1 comment
-
Hey, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
singleseeker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
no the relation is only for logging not for change detection. The event to log activity is triggered by the
Plan
model and then it will collect all attributes to log.