namespace App\Livewire\User; use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rule; use Livewire\Component; use Livewire\Attributes\Layout; #[Layout('layouts.frontend')] class ProfileUpdate extends Component { // User Core Fields public $name, $email, $phone, $whatsapp_number; public $password, $password_confirmation; // User Detail Fields public $company_name, $tax_number, $trade_license_no, $alternative_phone, $business_type = 'retailer', $address_line_1, $address_line_2, $city, $state, $post_code, $country = 'Bangladesh', $dob, $gender; public function mount() { $user = Auth::user(); $this->fill($user->toArray()); // User এর ডাটা ফিল্ডগুলোতে অটো বসবে if ($detail = $user->detail) { $this->fill($detail->toArray()); // Detail এর ডাটা ফিল্ডগুলোতে অটো বসবে } } protected function rules() { return [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', Rule::unique('users', 'email')->ignore(Auth::id())], 'phone' => ['nullable', 'string', 'max:20', Rule::unique('users', 'phone')->ignore(Auth::id())], 'password' => ['nullable', 'min:8', 'confirmed'], 'whatsapp_number' => ['nullable', 'string', 'max:20'], 'company_name' => ['nullable', 'string', 'max:255'], 'tax_number' => ['nullable', 'string', 'max:100'], 'trade_license_no' => ['nullable', 'string', 'max:100'], 'alternative_phone' => ['nullable', 'string', 'max:20'], 'business_type' => ['required', Rule::in(['wholesaler', 'distributor', 'retailer', 'fabricator'])], 'address_line_1' => ['nullable', 'string'], 'address_line_2' => ['nullable', 'string'], 'city' => ['nullable', 'string', 'max:100'], 'state' => ['nullable', 'string', 'max:100'], 'post_code' => ['nullable', 'string', 'max:20'], 'country' => ['required', 'string', 'max:100'], 'dob' => ['nullable', 'date'], 'gender' => ['nullable', Rule::in(['Male', 'Female', 'Other'])], ]; } public function updateProfileInformation(){ $validated = $this->validate(); $user = Auth::user(); // ১. ইউজার টেবিলের জন্য ডাটা প্রস্তুত করুন $userData = [ 'name' => $validated['name'], 'email' => $validated['email'], 'phone' => $validated['phone'], 'whatsapp_number' => $validated['whatsapp_number'], ]; // যদি পাসওয়ার্ড থাকে তবে সেটি অ্যারেতে যোগ করুন if (!empty($this->password)) { $userData['password'] = Hash::make($this->password); } // ২. একবারেই ইউজার টেবিল আপডেট করুন $user->update($userData); // ৩. ডিটেইলস টেবিল আপডেট (আপনার আগের লজিকটি পারফেক্ট আছে) $details = array_intersect_key($validated, array_flip([ 'company_name', 'tax_number', 'trade_license_no', 'alternative_phone', 'business_type', 'address_line_1', 'address_line_2', 'city', 'state', 'post_code', 'country', 'dob', 'gender' ])); $sanitizedDetails = array_map(fn($v) => ($v === '' || $v === null) ? null : $v, $details); $user->detail()->updateOrCreate(['user_id' => $user->id], $sanitizedDetails); // ৪. সাকসেস মেসেজ ও পাসওয়ার্ড ফিল্ড ক্লিয়ার করা $this->dispatch('notify', message: 'Your corporate profile updated securely!', type: 'success'); // নিরাপত্তার খাতিরে পাসওয়ার্ড ফিল্ডগুলো রিসেট করে দিন $this->reset(['password', 'password_confirmation']); } public function render(){ return view('livewire.user.profile-update'); } }
Invalid route action: [App\Livewire\User\ProfileUpdate].
Illuminate\Routing\RouteAction::makeInvokable()Illuminate\Routing\RouteAction::makeInvokable()Illuminate\Routing\RouteAction::parse()Illuminate\Routing\Route->parseAction()Illuminate\Routing\Route->__construct()Illuminate\Routing\Router->newRoute()Illuminate\Routing\Router->createRoute()Illuminate\Routing\Router->addRoute()Illuminate\Routing\Router->get()Illuminate\Support\Facades\Facade::__callStatic()180 Route::get('/orders/detail/{uuid}', UserOrderDetail::class)->name('orders.detail');181 Route::get('/orders/create/{productUuid?}', CreateOrder::class)->name('orders.create');182 // Notification: Registering standard stream channel for rendering or printing client invoice sheets183 Route::get('/orders/{uuid}/invoice', [OrderInvoiceController::class, 'print'])->name('orders.invoice');184 // বর্তমান লাইনটি সরিয়ে দিয়ে এটি বসান:185Route::get('/profile', \App\Livewire\User\ProfileUpdate::class)->name('profile');186 187 Route::get('/payment/process/{order}/{gateway}', [PaymentController::class, 'process'])->name('payment.process');188});189190// =========================================================================191// 💳 SECTION 3: SHARED AUTHENTICATED UTILITIES & CORE CALLBACKS192// =========================================================================193Route::middleware(['auth', 'verified'])->group(function () {194 Route::get('/download-file/{uuid}', [ProductDownloadController::class, 'download'])->name('product.download')->middleware(['signed']);195});196197Illuminate\Routing\RouteFileRegistrar->{closure:/home/u267282582/domains/amyradesign.com/public_html/routes/web.php:173}()Illuminate\Routing\Router->loadRoutes()Illuminate\Routing\Router->group()Illuminate\Routing\RouteRegistrar->group()168169// =========================================================================170// 👤 SECTION 2: SECURE USER PORTAL (Prefix: /user/*)171// =========================================================================172// Notification: Standard customer profile routes mapped under explicit aliases173Route::middleware(['auth', 'verified', 'customer.guard'])->prefix('user')->name('user.')->group(function () {174 175 Route::get('/dashboard', UserDashboard::class)->name('dashboard');176 Route::get('/wishlist', WishlistPage::class)->name('wishlist');177 Route::get('/my-inquiries', MyInquiries::class)->name('my.inquiries');178 Route::get('/compare', ComparePage::class)->name('compare'); // Secured user comparison sheet179 Route::get('/my-orders', CustomerOrderList::class)->name('orders');180 Route::get('/orders/detail/{uuid}', UserOrderDetail::class)->name('orders.detail');181 Route::get('/orders/create/{productUuid?}', CreateOrder::class)->name('orders.create');182 // Notification: Registering standard stream channel for rendering or printing client invoice sheets183 Route::get('/orders/{uuid}/invoice', [OrderInvoiceController::class, 'print'])->name('orders.invoice');184 // বর্তমান লাইনটি সরিয়ে দিয়ে এটি বসান:185require(string)Illuminate\Routing\RouteFileRegistrar->register()Illuminate\Routing\Router->loadRoutes()Illuminate\Routing\Router->group()Illuminate\Routing\RouteRegistrar->group()Illuminate\Foundation\Configuration\ApplicationBuilder->{closure:Illuminate\Foundation\Configuration\ApplicationBuilder::buildRoutingCallback():205}()Illuminate\Container\BoundMethod::{closure:Illuminate\Container\BoundMethod::call():35}()Illuminate\Container\Util::unwrapIfClosure()Illuminate\Container\BoundMethod::callBoundMethod()Illuminate\Container\BoundMethod::call()Illuminate\Container\Container->call()Illuminate\Foundation\Support\Providers\RouteServiceProvider->loadRoutes()Illuminate\Foundation\Support\Providers\RouteServiceProvider->{closure:Illuminate\Foundation\Support\Providers\RouteServiceProvider::register():53}()Illuminate\Container\BoundMethod::{closure:Illuminate\Container\BoundMethod::call():35}()Illuminate\Container\Util::unwrapIfClosure()Illuminate\Container\BoundMethod::callBoundMethod()Illuminate\Container\BoundMethod::call()Illuminate\Container\Container->call()Illuminate\Support\ServiceProvider->callBootedCallbacks()Illuminate\Foundation\Application->bootProvider()array_walk()Illuminate\Foundation\Application->boot()Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()Illuminate\Foundation\Application->bootstrapWith()Illuminate\Foundation\Http\Kernel->bootstrap()Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()Illuminate\Foundation\Http\Kernel->handle()Illuminate\Foundation\Application->handleRequest()1516// Bootstrap Laravel and handle the request...17/** @var Application $app */18$app = require_once __DIR__.'/../bootstrap/app.php';1920$app->handleRequest(Request::capture());21select exists (select 1 from information_schema.tables where table_schema = schema() and table_name = 'site_settings' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`select * from `site_settings` limit 1