Move mailer details into a separate table
This commit is contained in:
31
app/Models/Mailer.php
Normal file
31
app/Models/Mailer.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user