finish("/{$schema}"); if (!File::exists($schemaPath)) { return false; } $schemaContent = File::get($schemaPath); if (!Str::isJson($schemaContent)) { throw new \RuntimeException("{$schemaPath} is not a json schema ."); } $schemaContent = json_decode($schemaContent, true); $schemaRoute = route('fo.schema', ['schema' => $schema]); if (app()->environment('local')) { $schemaRoute = Str::replace('https', 'http', $schemaRoute); } Arr::set($schemaContent, '$id', $schemaRoute); return $schemaContent; } }