gruene-seele/app/Models/PaymentReminder.php

75 lines
2.5 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class PaymentReminder
*
* @property int $id
* @property string|null $title
* @property int|null $interval
* @property string|null $message
* @property string|null $action
* @property bool $active
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $subject
* @property string|null $clearingtype
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereAction($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereClearingtype($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereInterval($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereMessage($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereSubject($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|PaymentReminder whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
class PaymentReminder extends Model
{
protected $table = 'payment_reminders';
protected $casts = [
'interval' => 'int',
'active' => 'bool',
];
protected $fillable = [
'title',
'subject',
'interval',
'message',
'action',
'clearingtype',
'active',
];
protected static $clearingtypes = [
'fnc' => 'Rechnung',
'vor' => 'Vorkasse',
];
public function getClearingtype()
{
return isset(self::$clearingtypes[$this->clearingtype]) ? self::$clearingtypes[$this->clearingtype] : 'Kein Typ';
}
public static function returnClearingtypes()
{
return self::$clearingtypes;
}
}