1,
];
protected $with = ['owner'];
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->table = 'pages';//config('module.pages.table');
}
public function owner()
{
return $this->belongsTo(User::class, 'created_by');
}
/**
* @return string
*/
public function getActionButtonsAttribute()
{
return '
'.$this->getEditButtonAttribute('page', 'settings.page.edit').'
'.$this->getViewButtonAttribute().'
'.$this->getDeleteButtonAttribute('page', 'settings.page.destroy').'
';
}
/**
* @return string
*/
public function getViewButtonAttribute()
{
return '
';
}
/**
* @return string
*/
public function getStatusLabelAttribute()
{
if ($this->isActive()) {
return "';
}
return "';
}
/**
* @return bool
*/
public function isActive()
{
return $this->status == 1;
}
}