Skip to content

Commit

Permalink
Update Action.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Jan 29, 2024
1 parent 6bf8916 commit 0233322
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Action.php
Expand Up @@ -10,6 +10,9 @@

class Action extends Model
{
protected $appends = [
"entity",
];
protected $keyType = 'string';
protected $primaryKey = 'name';
protected $rules = [
Expand All @@ -32,9 +35,11 @@ public function permissions(): HasMany

public function getEntityAttribute(): string
{
return collect(explode("\\", $this->model_class))
$entity = collect(explode("\\", $this->model_class))
->last()
?? "";

return trim(ucwords(preg_replace('/[A-Z]/m', " $0", $entity)));
}

public function getModelClassAttribute(): string
Expand Down

0 comments on commit 0233322

Please sign in to comment.