*/ protected $fillable = [ 'name', 'description', 'is_active', // Add more fillable attributes as needed ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'is_active' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', // Add more casts as needed ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ // Add hidden attributes if needed ]; // Query Scopes /** * Scope a query to only include active records. */ public function scopeActive($query) { return $query->where('is_active', true); } /** * Scope for optimized queries with common relationships. */ public function scopeOptimized($query) { return $query->with($this->getOptimizedRelations()); } // ThrillWiki Methods /** * Get optimized relations for this model. */ public function getOptimizedRelations(): array { return [ // Define common relationships to eager load ]; } /** * Get cache key for this model instance. */ public function getCacheKey(string $suffix = ''): string { $key = strtolower(class_basename($this)) . '.' . $this->id; return $suffix ? $key . '.' . $suffix : $key; } }