redirect/app/Models/Site.php

29 lines
483 B
PHP
Raw Permalink Normal View History

2022-10-13 11:41:38 +00:00
<?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);
}
}