This commit is contained in:
Codex
2026-07-10 09:14:42 -05:00
parent e27fcc6c19
commit 63820994f8
55 changed files with 2195 additions and 86 deletions
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class ExternalProfileImportController extends Controller
{
public function store(Request $request): RedirectResponse
{
$profile = $request->user()->providerProfile;
abort_unless($request->user()->hasRole('provider') && $profile, 403);
$data = $request->validate([
'platform' => ['required', 'string', 'max:255'],
'external_id' => ['nullable', 'string', 'max:255'],
'profile_url' => ['nullable', 'url', 'max:255'],
'rating' => ['nullable', 'numeric', 'min:0', 'max:5'],
'review_count' => ['nullable', 'integer', 'min:0'],
'completed_jobs' => ['nullable', 'integer', 'min:0'],
'notes' => ['nullable', 'string'],
]);
$profile->externalImports()->create($data + [
'status' => 'manual',
'imported_at' => now(),
]);
return redirect()->route('providers.edit')->with('status', 'External profile snapshot saved.');
}
}