skip to Main Content

Laravel eloquent GROUP BY

I have four tables: supplies, stocks, stock_ins, and stock_outs. In the Stock controller, I want to sum the total stock_out for each supply . For this, I have used the following query: $supplies = Stock::select( 'supplies.name', 'stocks.supply_id', 'stocks.id', 'stocks.stock', 'stock_ins.quantity…

VIEW QUESTION

Laravel – Cannot authenticate using spa

I have my API that run on this url: https://example.com, and my vue.js app which runs on this: https://app.example.com. So I configured as the following the .env: SESSION_DOMAIN=.example.com SANCTUM_STATEFUL_DOMAINS=https://app.example.com the axios configuration contains the following: import axios from 'axios' const…

VIEW QUESTION

Laravel – Checkbox text value receive on checkbox check in livewire

In my Livewire View @foreach ($diagnosisList as $row) <div class="col-6 mb-2"> <div class="d-flex align-items-center"> <label class="form-check mb-0 w-120px"> <input wire:model.debounce.1000ms='diagnoses.{{ $row->id }}' data-name="{{ $row->name }}" class="form-check-input" type="checkbox" value="{{ $row->id }}"> <span class="form-check-label font-13 fw-medium">{{ $row->name }}</span> </label> </div> </div> @endforeach…

VIEW QUESTION

Laravel polymorphic relationship not working in Laravel Nova

I have the following Models and relationships. AppSubscriber.php <?php namespace AppModels; use IlluminateDatabaseEloquentModel; use IlluminateSupportFacadesDB; use IlluminateSupportStr; use IlluminateFoundationAuthUser as Authenticatable; use IlluminateNotificationsNotifiable; use GrosvLaravelPasswordlessLoginTraitsPasswordlessLogin; class Subscriber extends Authenticatable { use Notifiable, PasswordlessLogin; public function customFieldValues() { return $this->morphMany(CustomFieldValue::class, 'customFieldValueable');…

VIEW QUESTION
Back To Top
Search