File: /var/www/converter.rtfmfm.com/app/Fileactionconverter.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Fileactionconverter extends Model
{
protected $fillable = [
'converter_id',
'model',
'action_id',
'position',
];
protected $table = 'fileaction_converters';
public function converter()
{
return $this->belongsTo('App\Converter');
}
public function action_data()
{
return $this->hasOne('App\\' . $this->model, 'id', 'action_id');
}
public function getReadableModelAttribute()
{
if ($this->model == 'Actionsorting') {
return 'Сортиране по колона';
}
if ($this->model == 'Actionmergerow') {
return 'Обединяване на редове';
}
return $this->model;
}
}