Browse Forum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

simotion's avatar

Product pricing history vs performance — denormalization or single source of truth?

I originally had three price columns on my products table: price_purchase, price_sell and price_advice. To support pricing history, I introduced a ProductPrice model. The product_prices table contains: • id • product_id • price_type (purchase / sell / advice) • price_value • publisher_id • publisher_name (cached for when a user gets deleted) • timestamps Whenever a product is c

simotion's avatar
simotion's avatar simotion7mos agoLaravel
4
1
Last reply by simotion 7mos ago
rajaishtiaq6's avatar

Released a new package: Laravel ReverseKit — Generate full backend from JSON

Hey everyone, I just released a new open-source package called Laravel ReverseKit. It takes a JSON structure and generates a complete Laravel backend from it — without using AI. This means you can describe your output once, and it builds the whole backend around that structure. What it generates Models Migrations Controllers API Resources Form Requests Policies Factories Seed

rajaishtiaq6's avatar
rajaishtiaq6's avatar jlrdw7mos agoLaravel
1
1
Last reply by jlrdw 7mos ago
SoapyIllusion's avatar

Docker Container - Laravel Scheduler Best Practice

Hello All, Currently setting up a Laravel API app that uses Commands to pull data from an external API every hour in the background. That API data gets stored to a database. This app runs within a docker container that itself will live on VM. I am currently achieving this by setting up a scheduler that auto-restarts and runs the command php artisan schedule:run Ultimately I am

SoapyIllusion's avatar
SoapyIllusion's avatar SoapyIllus...7mos agoDevOps
4
1
Last reply by SoapyIllusion 7mos ago
Snapey's avatar

Forum still not showing replies immediately after posting

@jeffreyWay. This is still not fixed and is really annoying. Its not possible to post and then try to edit your reply because its not visible to the author. It may be visible to others, but not in my case for posts just made. They may appear some time later ?

Snapey's avatar
Snapey's avatar JeffreyWay7mos agoFeedback
4
1
Last reply by JeffreyWay 7mos ago
vincent15000's avatar

Weighted average => what's the easiest and more performant way ?

Hello, What's the easiest and more performant way to calculate a weighted average ? For the moment I do it manually and it works fine. I loop into the collection and calculate manually the sum ($value * $coefficient) and divide by the sum of the coefficients. But would you suggest me another way, perhaps more performant ? Via the collection helpers ? Something else ? Thanks for

vincent15000's avatar
vincent15000's avatar ndeblauw7mos agoCode Review
2
1
Last reply by ndeblauw 7mos ago
Chron's avatar

New table or a field instead?

I have Person and Cars table. Person could own multiple Cars. Person 1:M Cars But what if I want to ask, what Car does the Person "currently driving"? Person 1:1 Cars I thought of having a boolean field called driving in Cars table but I don't know. Should I create another table named Driving or something that holds both Person and Cars id? Or maybe a field driving_id

Chron's avatar
Chron's avatar vincent150...7mos agoGeneral
12
1
Last reply by vincent15000 7mos ago
Pixelairport's avatar

Inject validation rules in filament form field

Does anybody know, if it is possible to do something like: TextInput::make('title')->rules(['required','max:32']) instead of TextInput::make('title')->maxLength(32)->required(), because I want to use Spatie DTO also for Filament forms or is that a bad idea?

Pixelairport's avatar
Pixelairport's avatar Pixelairpo...7mos agoLaravel
4
1
Last reply by Pixelairport 7mos ago
earmsby's avatar

problem adding widget to resource

I can't figure out the source of an error I am getting when attempting to add a widget to a resource page. I think I've followed the example given in the filament docs (https://filamentphp.com/docs/4.x/resources/widgets) as closely as possible. Here is the relevant code on the resource: namespace App\Filament\Resources\Publications; use App\Filament\Resources\Publications\Pages

earmsby's avatar
earmsby's avatar earmsby7mos agoFilament
2
1
Last reply by earmsby 7mos ago
troccoli's avatar

Absolute URL in Scribe generated response

I have an API written using Resources in Laravel. The controller return a paginated response class SignInLogsController extends Controller { /** * @apiResourceCollection App\Http\Resources\SignInLogResource * @apiResourceModel App\Models\SignInLog paginate=15 */ public function __invoke(Request $request): ResourceCollection { return SignInLog::p

troccoli's avatar
troccoli's avatar troccoli7mos agoLaravel
2
1
Last reply by troccoli 7mos ago
Respect's avatar

How to custom css and js file in the laravel app with tailwind css configs

hello how to make custom css and js in the app for example app.css & admin.css & app.js & admin.js ( in my laravel livewire app ) with tailwind css - becasue i need make dffrent configs in each file and override colors for example i have app.blade.php <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <h

Respect's avatar
Respect's avatar Tray27mos agoLaravel
3
1
Last reply by Tray2 7mos ago
sahar_mkr's avatar

Testing

I want to test this api, here I can create a user but when I get to the controller it shows user is null, why this happens? this api works properly and is so simple but on the test the user created successfully but in controller it is null and makes test fail: public function index(User $user) { return success('User data', (new UserResource($user)); } this is my route:

sahar_mkr's avatar
sahar_mkr's avatar vincent150...7mos agoLaravel
3
1
Last reply by vincent15000 7mos ago
Michael Fayez's avatar

Weird behavior with mysql

I need to make a Many to many relationship between Leads table and 1- Tags 2- Gifts 3- Actions the relationship is working very well between Lead and Tags but on deployment of my project on Hostinger I have the following error for 2 days didn't removed SQLSTATE[HY000]: General error: 1005 Can't create table u754910178_sales.lead_gift (errno: 150 "Foreign key constraint is

Michael Fayez's avatar
Michael Fayez's avatar Tray27mos agoCode Review
6
1
Last reply by Tray2 7mos ago
ntbutler-nbcs's avatar

Dynamic Route Model Binding Properties in Requests

Hi all! I'm developing an API for a project, and would like to try to replicate a feature I've used on another site where the property that is used in the route model binding can be set dynamically by the party calling the API. For context, the API I'm looking to replicate this feature with is the Canvas LMS API, specifically with the SIS ID feature that they have implemented.

ntbutler-nbcs's avatar
ntbutler-nbcs's avatar Snapey7mos agoLaravel
2
1
Last reply by Snapey 7mos ago
TerrePorter's avatar

@tailwindcss/vite and @vitejs/plugin-vue have error in phpstorm

The packages are underline in red and give an error: Vue: Cannot find module  @tailwindcss/vite  or its corresponding type declarations. There are types at 'c:/local_devel/Code/_play/rcvue.lan/node_modules/@tailwindcss/vite/dist/index.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundl

TerrePorter's avatar
TerrePorter's avatar LaryAI7mos agoVite
2
1
Last reply by LaryAI 7mos ago
SammyAttemptsCode's avatar

Results page not showing after hitting browser's "Back" button

Hi, First time I have to reach for the forums with an issue. AI assistance seems not to be able to find the issue either. TLDR: When navigating back from a Product page back to the Search Results page, the DOM doesn't update back to the Results page. Here's the context: (Inertia, vue) I have a very simple search results page scaffold to test. In there, I have a UL with LI that

SammyAttemptsCode's avatar
SammyAttemptsCode's avatar LaryAI7mos agoVue
6
2
Last reply by LaryAI 7mos ago
Kaluna's avatar

Laravel/Vue PWA, magic login link?

Hey everyone, I've scoured the internet trying to find a solution to this. So, I am creating a "magic login link" like so: $url = URL::temporarySignedRoute('login.token', now()->addHour(), ['user' => $user->id]);. This works fine on desktop—but once the PWA is downloaded, it doesn't work (it does on Chrome, locally mind). I've tried using protocol urls (web+m

Kaluna's avatar
Kaluna's avatar LaryAI7mos agoLaravel
2
1
Last reply by LaryAI 7mos ago
DigitalViking's avatar

Prevent race conditions and queue best practices

Hi Laracasts community, I’m currently facing an issue in our application for which I haven’t yet found a fully satisfying solution. Let me give you some context: I’m working on a multi-integration setup in the e-commerce space. The application connects our ERP system with multiple fulfillment partners. It handles various data flows (product data, stock levels, orders, and shipp

DigitalViking's avatar
DigitalViking's avatar LaryAI7mos agoLaravel
7
2
Last reply by LaryAI 7mos ago
earmsby's avatar

queue worker on production

I've been playing around with Filament Exporting & Importing and it's pretty nice. Of course it uses job batches in order to process the imports and exports. In my local development (with herd) I've just run php artisan queue:work before trying to import/export and that's fine. But I'm about to push this functionality up to the live production server (on Forge). Do I just r

earmsby's avatar
earmsby's avatar LaryAI7mos agoLaravel
5
4
Last reply by LaryAI 7mos ago
vincent15000's avatar

It's not possible to like a post / comment any more

Hello, It's not possible to like a post or a comment any more. V

vincent15000's avatar
vincent15000's avatar vincent150...7mos agoFeedback
7
6
Last reply by vincent15000 7mos ago
shez1983's avatar

dusk - tests failing

$browser ->fillForm($post, [$field]) ->screenshot('debug 1') ->press('@submit') ->waitFor('@' . $field . '-error', 10); ; so notice i have screenshot() there.. if i remove that this test will fail. it leads me to think that the delay is needed somehow.. funny thing is delay should be added AFTER i press submit to give it time to process and show error.. in other tes

shez1983's avatar
shez1983's avatar vincent150...7mos agoTesting
1
1
Last reply by vincent15000 7mos ago
pgogy's avatar

Trying to understand policies

Hello, trying to use policies properly and I'm following the guidance (https://laravel.com/docs/12.x/authorization) but it's not working for me. I'm new, and I'm guessing I've missed something big. So I have a File model, and I want users to be able to see only their own files. I have a FilePolicy in app\Policies so it should auto register. I have seen examples using AuthServic

pgogy's avatar
pgogy's avatar pgogy7mos agoLaravel
14
1
Last reply by pgogy 7mos ago
dmytroshved's avatar

VueJS 3: Storing Token & User. Code Analyzing

Hey everyone I am analyzing the code of RealWorld Example (Vue 3 + Pinia) and I'm trying to understand the author's logic for storing the user and token. Below is a summary of what I observed. 1. User storage in localStorage The app uses a custom Storage class to store the user object (from what I understood including the token) in localStorage: // src/utils/storage.ts export

dmytroshved's avatar
dmytroshved's avatar vincent150...7mos agoVue
2
4
Last reply by vincent15000 7mos ago
Shivamyadav's avatar

Input component is not working on the production 😕

I'm getting this error on every form except the login form (login and register form is working Even they are also using the same input component). Unable to locate a class or view for component [forms.input-group].

Shivamyadav's avatar
Shivamyadav's avatar Shivamyada...7mos agoLaravel
3
1
Last reply by Shivamyadav 7mos ago
Davexdiamond's avatar

Livewire wire:navigate issue

this problem is based on my DOM elements and my javascript when ever i click on an element that has the wire:navigate attribute the SPA works but not all my content gets rendered in my webpage but if i inspect it, those element are present in the code but aren't showing and i keep getting this error from my javascript script file telling me that i am redeclaring and element aga

Davexdiamond's avatar
Davexdiamond's avatar Davexdiamo...7mos agoLaravel
2
1
oldgit's avatar

Validation - unique within subset of records

I'm trying to validate a piece of data against a subset of records in a table. The big picture is that I have a table of competiton entries for multiple competitions. Each entry must have a unique number (to be displayed by the entrant) for obvious reasons. The Entry table includes a field - competitionID - which links the Entry to the Competition. I can easily use the 'unique'

oldgit's avatar
oldgit's avatar vincent150...7mos agoLaravel
6
1
Last reply by vincent15000 7mos ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.