Level 75
Use trait for that.
2 likes
Hello, would it be possible to reuse this without having to define these 2 relationships in each model?
public function createdBy(): BelongsTo
{
return $this->belongsTo(User::class, 'created_by');
}
public function updatedBy(): BelongsTo
{
return $this->belongsTo(User::class, 'updated_by');
}
Thanks
Please or to participate in this conversation.