We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The user in the parent table is not updated when the child record is modified. For the field "updated_at" if the date is updated
In the model the child table defines the attribute "touches".
protected $touches = ['persons']; /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ public function persons() { return $this->belongsTo('App\Models\ContactPerson', 'contact_id', 'id'); }
regards
The text was updated successfully, but these errors were encountered:
I have returned to topic and found the following solution. The following code must be added in all methods: Creating, Deleting, Restoring, Uddating.
foreach ($model->getTouchedRelations() as $relation) { $model->$relation->{$model->getUpdatedByColumn()} = Auth::id(); $model->$relation->save(); }
I have successfully tested on Creating, Uddating.
Sorry, something went wrong.
I have returned to topic and found the following solution. The following code must be added in all methods: Creating, Deleting, Restoring, Uddating. foreach ($model->getTouchedRelations() as $relation) { $model->$relation->{$model->getUpdatedByColumn()} = Auth::id(); $model->$relation->save(); } I have successfully tested on Creating, Uddating. regards
I am new to laravel can you please guide me how and where to do this . Its urgent
No branches or pull requests
The user in the parent table is not updated when the child record is modified.
For the field "updated_at" if the date is updated
In the model the child table defines the attribute "touches".
regards
The text was updated successfully, but these errors were encountered: