update code

This commit is contained in:
manhlab
2021-04-07 06:32:42 -04:00
parent 7fb98911a6
commit a4753625f6
779 changed files with 335717 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Entities;
use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;
/**
* Class Attachment.
*
* @package namespace App\Entities;
*/
class Attachment extends Model implements Transformable
{
use TransformableTrait;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id',
'document_id',
'name',
'extension',
'size',
'path',
'downloads',
];
/**
* All of the relationships to be touched.
*
* @var array
*/
protected $touches = ['document'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'size' => 'decimal:2',
'downloads' => 'integer'
];
public function document(){
return $this->belongsTo(Document::class);
}
}