clrghouz/app/Models/Mailer.php

31 lines
434 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Mailer extends Model
{
public $timestamps = FALSE;
private const SORTORDER = [
'BINKP'=>1,
'EMSI'=>2,
];
/* RELATIONS */
public function system()
{
return $this->belongsTo(System::class);
}
/* SCOPES */
public function scopePreferred($query)
{
return $query
->orderBy('priority','ASC')
->where('mailer_system.active',TRUE);
}
}