clrghouz/app/Models/Zone.php
2021-06-13 01:32:22 +10:00

29 lines
370 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Traits\ScopeActive;
class Zone extends Model
{
use ScopeActive;
/* RELATIONS */
public function domain()
{
return $this->belongsTo(Domain::class);
}
/* SCOPES */
/**
* Only query active records
*/
public function scopePublic()
{
return $this->where('public',TRUE);
}
}