File: /var/www/console.fixgini.com/app/Http/Controllers/Seller/ProfileController.php
<?php
namespace App\Http\Controllers\Seller;
use App\Models\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ProfileController extends Controller
{
public function store(Request $request)
{
try {
$validatedData = $request->validate([
"display_name" => "required|string",
"occupation" => "required|string",
"skill" => "required|string",
"description" => "required|string",
"education" => "required|string",
"certifications" => "required|string",
"website" => "required|string",
"category_id" => "required|string|exists:countries,id",
"hotline_line" => "required|string",
"language" => "required|string",
"address" => "required|string",
"city" => "required|string",
"state" => "required|string",
"country_id" => "required|string",
"facebook" => "required|string",
"other_social" => "required|string",
"profile_image" => "required|string",
"intro_video" => "required|string",
"intro_image" => "required|string",
"user_id" => "required|exists:users,id",
]);
} catch (\Throwable $th) {
return response()->json(['error' => $th->getMessage()], 500);
}
$user = User::findOrFail($validatedData['user_id']);
$user->update([
'address' => $validatedData['address'],
]);
}
}