mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-06 04:35:11 +02:00
* refactor: migration from laravel-enum package to native php enums * style: fix StyleCI findings
28 lines
485 B
PHP
28 lines
485 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Concerns\Enums;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* Trait FormatsPermission.
|
|
*/
|
|
trait FormatsPermission
|
|
{
|
|
/**
|
|
* Format permission name for model.
|
|
*
|
|
* @param string $modelClass
|
|
* @return string
|
|
*/
|
|
public function format(string $modelClass): string
|
|
{
|
|
return Str::of($this->value)
|
|
->append(class_basename($modelClass))
|
|
->snake(' ')
|
|
->__toString();
|
|
}
|
|
}
|