Files
kartoteka/app/Models/ArchiveInfo.php

37 lines
661 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ArchiveInfo extends Model
{
protected static function booted()
{
static::creating(function (ArchiveInfo $model) {
$model->status_id = 2;
});
}
protected $connection = 'pgsql';
protected $table = 'archive_infos';
protected $fillable = [
'historyable_type',
'historyable_id',
'num',
'post_in',
'status_id'
];
public function historyable()
{
return $this->morphTo();
}
public function status()
{
return $this->belongsTo(ArchiveStatus::class);
}
}