fixing multiple references
This commit is contained in:
@@ -16,19 +16,13 @@ class CompileSchemas extends Command
|
||||
protected $description = 'Compiles schemas';
|
||||
|
||||
|
||||
public function __construct(
|
||||
public SchemaService $schemaService
|
||||
)
|
||||
public function handle(SchemaService $schemaService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$configDir = base_path(config('lucent.schemas_path'));
|
||||
$schemasDirIterator = new DirectoryIterator($configDir);
|
||||
$schemas = [];
|
||||
|
||||
foreach ($schemasDirIterator as $file) {
|
||||
if ($file->getExtension() !== "json") {
|
||||
continue;
|
||||
@@ -46,7 +40,7 @@ class CompileSchemas extends Command
|
||||
|
||||
$schemas = collect($schemas)->sortBy("label")->values();
|
||||
$roles = $schemas
|
||||
->map([$this->schemaService, 'fromArray'])
|
||||
->map([$schemaService, 'fromArray'])
|
||||
->whereIn("type", [Type::COLLECTION, Type::FILES])
|
||||
->reduce(fn($carry, Schema $schema) => array_merge(
|
||||
$carry,
|
||||
|
||||
Reference in New Issue
Block a user