3 namespace BookStack\Activity\Models;
5 use BookStack\Permissions\Models\JointPermission;
7 use Illuminate\Database\Eloquent\Model;
8 use Illuminate\Database\Eloquent\Relations\HasMany;
12 * @property int $user_id
13 * @property int $watchable_id
14 * @property string $watchable_type
15 * @property int $level
16 * @property Carbon $created_at
17 * @property Carbon $updated_at
19 class Watch extends Model
21 protected $guarded = [];
23 public function watchable()
28 public function jointPermissions(): HasMany
30 return $this->hasMany(JointPermission::class, 'entity_id', 'watchable_id')
31 ->whereColumn('favourites.watchable_type', '=', 'joint_permissions.entity_type');