coolify/app/Models/Tag.php
Andras Bacsai 9f46586d4a refactor: define explicit fillable attributes on all Eloquent models
Replace $guarded usage with explicit $fillable arrays across all models.
Sync fillable definitions with current database schema and add tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 21:25:41 +02:00

34 lines
635 B
PHP

<?php
namespace App\Models;
use App\Traits\HasSafeStringAttribute;
class Tag extends BaseModel
{
use HasSafeStringAttribute;
protected $fillable = [
'name',
];
protected function customizeName($value)
{
return strtolower($value);
}
public static function ownedByCurrentTeam()
{
return Tag::whereTeamId(currentTeam()->id)->orderBy('name');
}
public function applications()
{
return $this->morphedByMany(Application::class, 'taggable');
}
public function services()
{
return $this->morphedByMany(Service::class, 'taggable');
}
}