argument('file'); $phaseId = $this->argument('phase_id'); $phase = Phase::findOrFail($phaseId); $file = new \Illuminate\Http\UploadedFile($filePath, basename($filePath)); $geojson = SpatialFileConverter::convertToGeoJson($file, $file->getClientOriginalName()); if ($geojson) { $layer = $phase->layers()->create([ 'project_id' => $phase->project_id, 'name' => 'Converted: ' . basename($filePath), 'geojson_data' => $geojson, 'uploaded_by' => 1, // admin 'original_file' => $filePath ]); $this->info("GeoJSON saved to layer ID {$layer->id}"); } else { $this->error("Conversion failed for file type."); } } }