You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
512 B
26 lines
512 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class RoleHasPermission extends CommonModel
|
|
{
|
|
protected $appends = ['auth_node_tags_array'];
|
|
|
|
public $timestamps = false;
|
|
|
|
public function getAuthNodeTagsArrayAttribute($value)
|
|
{
|
|
if (!empty($this->attributes['auth_node_tags'])) {
|
|
return explode(',', $this->attributes['auth_node_tags']);
|
|
}
|
|
return [];
|
|
}
|
|
|
|
|
|
public function permissions()
|
|
{
|
|
return $this->hasOne(Permission::class, 'id', 'permission_id');
|
|
}
|
|
|
|
}
|