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.
24 lines
509 B
24 lines
509 B
|
6 months ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
class Permission extends SoftDeletesModel
|
||
|
|
{
|
||
|
|
protected $table = "permissions";
|
||
|
|
protected $appends = ['auth_node_tags_array'];
|
||
|
|
|
||
|
|
public function scopeOfGuard($query, $guard)
|
||
|
|
{
|
||
|
|
return $query->where("guard_name", $guard);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getAuthNodeTagsArrayAttribute($value)
|
||
|
|
{
|
||
|
|
if (!empty($this->attributes['auth_node_tags'])) {
|
||
|
|
return explode(',', $this->attributes['auth_node_tags']);
|
||
|
|
}
|
||
|
|
return [];
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|