513 questions
3 votes
1 answer
39 views
Laravel Livewire/Eloquent: Position update fails when moving task to first position (index 1) of a different list
My application uses Laravel Livewire with Alpine.js/SortableJS for drag-and-drop reordering of tasks between status columns. The tasks have a status (string) and a position (integer) in the database. ...
0 votes
1 answer
103 views
Laravel migration creates wrong columns and data mismatch in employers table
I’m building a job board project in Laravel, and I’m trying to establish a one-to-one relationship between User and Employer. However, my database table is not being generated correctly — the columns ...
0 votes
0 answers
59 views
How to prevent Stripe customer balance (credits) from being used during subscription creation or update in Laravel or Stripe API?
I’m working with Stripe subscriptions and customer balances (credits). By default, when a customer has credits in Stripe, Stripe automatically applies those credits toward the next invoice or ...
0 votes
1 answer
94 views
Switching from registering Service Providers in configuration to providers.php when upgrading to Laravel 11
I have a Laravel application originally developed in Laravel 10, but I have since upgraded the application to Laravel 12. One of the changes starting in Laravel 11 is that custom service providers are ...
0 votes
0 answers
61 views
How does Eloquent's new Laravel 11 HasScopedValues feature address it and how is it different from casts?
In Laravel 11, Eloquent introduced HasScopedValues to define scoped values for model attributes somewhat like $casts. I’m unclear how it differs from $casts can it transform values like casts or is it ...
2 votes
0 answers
59 views
Migrations & Seeders & Command for production data [duplicate]
Recently after some research I came up with a question: how to handle default / initial data population in a Laravel project which goes live: should it go into seeders or migrations? I've seen two ...
3 votes
0 answers
265 views
How to retain session after redirect in Laravel
I'm using Laravel's database notifications. When a user clicks on a notification, it first redirects to a controller that sets some session data, then redirects again to the final URL. However, on the ...
0 votes
0 answers
68 views
getting unauthenticated error in phonepe refund api
i am getting problem of getting unauthenticated in the phonepe refund api. also i am using that token in the payment time it's working fine. $data = $this->getAuthKey(); $payment = Payment::...
1 vote
1 answer
82 views
Attribute Accessors not working after laravel app upgrade
Laravel accessor not working after I upgraded from v8.75 to v11.31 I had this LARAVEL v8.75 App where in the User model I created an Accessor for photo like below public function getPhotoAttribute($...
0 votes
1 answer
180 views
Laravel 11 Events Firing Multiple Times in Production (Nginx, Azure App Services, PHP 8.3)
I'm encountering an issue where Laravel events are firing multiple times, but only in the production environment. Environment: Laravel: 11.x PHP: 8.3 Web Server: Nginx Hosting: Azure App Services ...
-1 votes
1 answer
800 views
When creating a Laravel project, is the kernel.php in the http and console folders already there? Why isn't it there in mine?
i have created a middleware public function handle(Request $request, Closure $next) { if (!auth()->check() || auth()->user()->role !== 'admin') { abort(403, '...
0 votes
0 answers
37 views
Livewire /upload-file not triggered when selecting a file
I have a Livewire Component Import.php: <?php namespace Modules\Donor\app\Livewire\Modals; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Notification; use Illuminate\Support\...
1 vote
2 answers
99 views
Admin middleware does not work properly in Laravel
I have made a middleware for admin routes public function handle(Request $request, Closure $next) { if (!auth()->check() || !auth()->user()->is_admin) { abort(401); } ...
0 votes
4 answers
278 views
Rounding floats / decimals in e-commerce (PHP 8.3 and Laravel 11)
So due to the fact that product quantities are not limited to integers but can store decimals up to 4 digits, I can have a product with quantity of 69.4160 square meters of something. Now assuming the ...
0 votes
1 answer
44 views
Laravel Scheduler Not Running Even Though It’s Configured in EC2
I have a Laravel scheduler configured to run every 6 hours. Based on the schedule, it should have already executed, but I don’t see any expected results or changes from it. I also added a logger() ...