feat : admin aspect

This commit is contained in:
2025-09-15 14:45:29 +08:00
parent 8665b27294
commit 8046676669
11 changed files with 430 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Trait;
trait ParserRouterTrait
{
/**
* @param $callback
* @return array|string[]|null
*/
final protected function parse($callback): ?array
{
if (is_array($callback) && count($callback) == 2) return $callback;
if (is_string($callback)) {
if (str_contains($callback, '@')) $explode = explode('@', $callback);
if (str_contains($callback, '::')) $explode = explode('::', $callback);
if (isset($explode) && count($explode) === 2) return $explode;
}
return null;
}
}