Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

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

tanjilurrahman21's avatar

Laravel Developer Working in CodeIgniter

Hello, I have recently joined a company for the php developer role. Previously I had 1 year experience working with laravel, react. Now at my new job I have to work with legacy code. so php 7 codeigniter 3.1. As a laravel developer I do find it demotivating to work on a tech that is outdated. I am seeking for suggestions like if I work here for a year or two what should be the

tanjilurrahman21's avatar
tanjilurrahman21's avatar jlrdw6mos agoLaravel
3
1
Last reply by jlrdw 6mos ago
Chron's avatar

Order based on similarities

// Post m:n Category $post = Post::find(1); Post::whereHas('categories', function($q) { $q->whereIn('categories.id', $post->categories->pluck('id')->toArray()) ->where('posts.id', '<>', $post->id); })->get(); Currently it's ordered by id. For example The categories of Post#1 are id [2,3] and the second query gives [ // Post id: 2 that has categ

Chron's avatar
Chron's avatar Shivamyada...6mos agoEloquent
1
1
Last reply by Shivamyadav 6mos ago
wcampbel's avatar

Herd doesn't recognize installed version of node. Windows 11.

I have nodejs 22.21.1 installed. This is visible in the Herd GUI and when I run a command line node -v. The problem is when I run npm run dev. It errors out saying: "You are using Node.js 17.7.2. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version." I don't even know where Herd is getting that from. I have NVM and have tried to forc

wcampbel's avatar
wcampbel's avatar wcampbel6mos agoVite
2
3,257
Last reply by wcampbel 6mos ago
Talinon's avatar

updateOrCreate() case sensitivity

Context: Synchronizing data with Microsoft's Graph API Problem: Items have immutable ids that are case sensitive. There are many occurrences where unique items have the exact same Id, except for a single character having a different casing. i.e.: (notice the 4th last character) Item #1: EWg0AQbLDgfAFWEaaZsFuzmolNQAAAADDIQAA Item #2: EWg0AQbLDgfAFWEaaZsFuzmolNQAAAADDiQAA Whe

Talinon's avatar
Talinon's avatar JussiManni...6mos agoEloquent
5
1
Last reply by JussiMannisto 6mos ago
Developer654079525's avatar

Type hinting

In production, are you actually using type hinting or not? Specifically for relationship and controller methods. Do you treat it as a nice-to-have or something actually worth having?

Developer654079525's avatar
Developer654079525's avatar martinbean6mos agoLaravel
5
1
Last reply by martinbean 6mos ago
psizer10's avatar

Encrypted .env breaks application

I am having some issues when trying to utilise an encrypted environment file. Without it, deployments run successfully, and my app works fine. However, when I deploy the encrypted env there are problems. I've tracked it (I think) to the fpmRuntime and encounter the following error. { "exception": { "class": "Symfony\Component\Console\Exception\Comma

psizer10's avatar
psizer10's avatar joshdonnel...6mos agoVapor
1
1
Last reply by joshdonnell 6mos ago
fitim's avatar

Laravel 12 – php artisan schedule:run causes periodic CPU spikes even with no scheduled tasks

I’m running into a strange performance issue with the Laravel scheduler and I’m trying to understand what’s going on. Framework: Laravel 12 PHP: 8.2 Web server: Apache on Linux "require": { "php": "^8.2", "ext-curl": "", "ext-openssl": "", "firebase/php-jwt": "^6.11", "laravel/framewo

fitim's avatar
fitim's avatar Glukinho6mos agoLaravel
21
1
Last reply by Glukinho 6mos ago
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 simotion6mos agoLaravel
4
1
Last reply by simotion 6mos 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 jlrdw6mos agoLaravel
1
1
Last reply by jlrdw 6mos 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...6mos agoDevOps
4
1
Last reply by SoapyIllusion 6mos 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 JeffreyWay6mos agoFeedback
4
1
Last reply by JeffreyWay 6mos 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 ndeblauw6mos agoCode Review
2
1
Last reply by ndeblauw 6mos 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...6mos agoGeneral
12
1
Last reply by vincent15000 6mos 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...6mos agoLaravel
4
32
Last reply by Pixelairport 6mos 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 earmsby6mos agoFilament
2
2
Last reply by earmsby 6mos 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 troccoli6mos agoLaravel
2
1
Last reply by troccoli 6mos 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 Tray26mos agoLaravel
3
1
Last reply by Tray2 6mos 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...6mos agoLaravel
3
1
Last reply by vincent15000 6mos 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 Tray26mos agoCode Review
6
1
Last reply by Tray2 6mos 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 Snapey6mos agoLaravel
2
758
Last reply by Snapey 6mos 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 LaryAI6mos agoVite
2
19
Last reply by LaryAI 6mos 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 LaryAI6mos agoVue
6
1
Last reply by LaryAI 6mos 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 LaryAI6mos agoLaravel
2
1
Last reply by LaryAI 6mos 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 LaryAI6mos agoLaravel
7
48
Last reply by LaryAI 6mos 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 LaryAI6mos agoLaravel
5
209
Last reply by LaryAI 6mos 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.