2018-11-30 15:45:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Models;
|
|
|
|
|
|
|
|
use Common\Model;
|
|
|
|
|
|
|
|
class Upload extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'zz_files';
|
|
|
|
|
2018-11-30 19:40:06 +01:00
|
|
|
public function getCategoryAttribute()
|
|
|
|
{
|
|
|
|
return $this->attributes['category'] ?: 'Generale';
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Relazioni Eloquent */
|
|
|
|
|
2018-11-30 15:45:43 +01:00
|
|
|
public function module()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Module::class, 'id_module');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function plugin()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Plugin::class, 'id_plugin');
|
|
|
|
}
|
|
|
|
}
|