refactor:拆分 API 路由与请求校验,统一 final 类和代码风格
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Support\AdminPermissionBridge;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AdminRole extends Model
|
||||
final class AdminRole extends Model
|
||||
{
|
||||
protected $table = 'admin_roles';
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (AdminRole $role): void {
|
||||
self::creating(function (AdminRole $role): void {
|
||||
if (($role->code ?? '') === '' && is_string($role->slug) && $role->slug !== '') {
|
||||
$role->code = $role->slug;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user