redirect/app/Models/Site.php
2022-10-22 19:16:50 +11:00

29 lines
483 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Site extends Model
{
use HasFactory;
protected $fillable = [
'site',
];
/* RELATIONS */
public function uris()
{
return $this->hasMany(SiteUri::class);
}
/* ATTRIBUTES */
public function getActiveAttribute(bool $value): bool
{
return $value && (strlen($this->redirect) > 0);
}
}