'integer', 'categories_id' => 'integer', ]; } protected static function booted(): void { static::saved(static function (self $excludedCategory): void { Cache::forget(User::categoryExclusionCacheKey($excludedCategory->users_id)); }); static::deleted(static function (self $excludedCategory): void { Cache::forget(User::categoryExclusionCacheKey($excludedCategory->users_id)); }); } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class, 'users_id'); } /** * @return BelongsTo */ public function category(): BelongsTo { return $this->belongsTo(Category::class, 'categories_id'); } }