Move mailer details into a separate table

This commit is contained in:
2023-07-07 23:59:04 +10:00
parent ad4ea699a5
commit ccdce6bb62
12 changed files with 274 additions and 112 deletions

31
app/Models/Mailer.php Normal file
View File

@@ -0,0 +1,31 @@
<?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);
}
}