Blog

useState Hook in React

User usestate in react Assistant `useState` is a Hook in React that lets you add **state** to functional components. ### 🔧 Syntax: const [state, setState] = useState(initialValue); – `state` is the current state value. – `setState` is the function to update the state. – `initialValue` is the starting value of the state. — ### 🧠 […]

Awork hour issue

User Also I'm not able add hours in awork because there is a some problem it always send me to prevdate when try to add hours Correct above sentence Assistant Sure, here’s the corrected version of your sentence: **"Also, I'm not able to add hours in Awork because there's an issue—it always redirects me to […]

Encrypt Client ID Accessor

User // Encrypt the IDs for each client item $clients->getCollection()->transform(function ($client) { $client->encrypted_id = Crypt::encrypt($client->id); return $client; }); add this in client model Assistant To move the logic of adding an `encrypted_id` to the **Client** model, you can create a custom **accessor** in the model. Here's how to do it cleanly: ### ✅ Step-by-step: #### […]

Bootstrap 5 Tab Persistence

User {{ __('Customer Details') }} {{ __('Survey') }} {{ __('Participants') }} bootstrap 5 tab store last tab opened and display that tab when again comes to that page Assistant To **store and restore the last opened Bootstrap 5 tab**, you can use `localStorage`. Here’s a complete solution: — ### ✅ **1. HTML (Your Tabs)** Update […]

Initialize Vue App Laravel

User We have a section in laravel for survey and we have applied vue on edit,create and index pages but now want to initials creatApp once for all 3 pages Assistant To initialize a single Vue app instance across multiple Laravel Blade views (like `create`, `edit`, and `index` of a survey section), the best practice […]

Vue Blade Conflict Fix

User @extends('layouts.admin') @section('plugins.Datatables', true) @section('plugins.Sweetalert2', true) {{– Customize layout sections –}} @section('subtitle', 'Surveys') {{– Content body: main page content –}} @section('content_body') {{ __('Surveys') }} {{ __('Add Survey') }} @if ($errors->any()) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif @if (session()->has('message.level')) {!! session('message.content') !!} @endif Loading… {{ __('Loading survey creation…') }} @if (session()->get('success')) {{ session()->get('success') […]

Validation Rule Update

User $request->validate([ 'email' => 'required|email', 'salutation' => 'required', 'first_name' => 'required', 'last_name' => 'sometimes', 'industry' => 'required', 'company_name' => 'required', 'coach_name' => 'required|unique:clients,coach_name', 'terms' => 'accepted', ],[ 'coach_name.unique' => 'The coach name has already been taken. Please choose a different name.', 'terms.accepted' => 'You must agree to the Terms, Privacy, and Fees.', ]); unique will […]

Deploy Vue to Firebase

User Deploy vue js dist folder from github to firbase hosting Assistant To deploy a Vue.js app from a GitHub repository to Firebase Hosting, follow these steps: — ### **1. Build Your Vue App** If you haven't already: npm run build or yarn build This creates a `dist/` directory containing your production-ready files. — ### […]

Yarn create-vue error fix

User PS Microsoft.PowerShell.CoreFileSystem::\wsl$Ubuntuhomeneeraj_iwariprojects> wsl neeraj_iwari@BOOK-VKAD2MI9OH:~/projects$ yarn create vue@latest yarn create v1.22.22 [1/4] Resolving packages… [2/4] Fetching packages… [3/4] Linking dependencies… [4/4] Building fresh packages… success Installed "create-vue@3.16.4" with binaries: – create-vue [##] 2/2/bin/sh: 1: /home/neeraj_iwari/.yarn/bin/create-vue@latest: not found error Command failed. Exit code: 127 Command: /home/neeraj_iwari/.yarn/bin/create-vue@latest Arguments: Directory: /home/neeraj_iwari/projects Output: Assistant The error you're seeing: /bin/sh: […]

Create Git Branch

User create branch in git Assistant To create a new branch in Git, use the following command: git checkout -b your-branch-name ### Full Steps: 1. **Navigate to your repository:** cd /path/to/your/repo 2. **Fetch the latest changes (optional but recommended):** git fetch origin 3. **Create and switch to a new branch:** git checkout -b feature-branch-name 4. […]