You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
489 B
24 lines
489 B
<?php
|
|
|
|
namespace App\Entities\Users;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Activity extends Model
|
|
{
|
|
protected $table = 'user_activities';
|
|
|
|
protected $fillable = ['type', 'parent_id', 'user_id', 'object_id', 'object_type', 'data'];
|
|
|
|
protected $casts = ['data' => 'array'];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class)->withDefault(['name' => 'n/a']);
|
|
}
|
|
|
|
public function object()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|