29 lines
483 B
PHP
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);
|
||
|
}
|
||
|
}
|