212,679 questions
1
vote
1
answer
106
views
Filament PHP: Memory exhausted when selecting all table records (500k+ rows) - How to limit or optimize?
I'm using Filament PHP v3 with Laravel and have a table that can contain 500,000+ user records. When users click the "Select All" button the application crashes with a memory exhausted error:...
0
votes
0
answers
89
views
Document AI importDocument returns error code 13 when using REST API
I’m currently having an issue with my code — I’m using the REST API to train a Document AI model with the custom extraction type.
I have already completed the following steps:
Called the v1 process ...
3
votes
2
answers
92
views
Automatically set timestamps on polymorphic relation table
I have a ProductLandedCost model with a morphToMany relationship to various other models: Warehouse, for example:
class Warehouse extends Model
{
// ...
public function productLandedCosts(): ...
0
votes
1
answer
55
views
Laravel Sail + Xdebug
I have Laravel Sail installed in WSL, and I'm trying to debug the application using Xdebug. This only works if I enter the WSL IP address directly into the browser (http://172.17.170.44:8000). If I ...
0
votes
1
answer
71
views
Vitest config for Laravel and Vue
I have a Laravel 12 project built with the Vue starter kit. By default, the project didn't have any frontend testing libraries. I want to add tests in Vitest. When I run vitest, I get the error: Error:...
-2
votes
0
answers
105
views
Laravel: Authenticated user can’t access protected routes after login (auth middleware always redirects to login or shows 404)
I’m building a Laravel job board website where only logged-in users can create, edit, or delete jobs.
I’ve implemented middleware authorization, but even after logging in successfully, I can’t access ...
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
69
views
Why notification is not called when data are saved and redirected to other page?
On laravel/vue/inertiajs/element-plus site I make notification when data are saved and redirected to other page
public function update(TaskRequest $request, int $taskId)
{
\Log::info( '-1 ...
Advice
0
votes
5
replies
149
views
Why does Laravel 12 load routes in the bootstrap file instead of RouteServiceProvider
In Laravel 10, we had a RouteServiceProvider class that handled loading up all your different routes. This is a snippet from that file in an older project I worked on using Laravel 10:
...
2
votes
2
answers
105
views
Laravel images not showing on Hostinger, returning 404 after upload
I have a Laravel project deployed on Hostinger shared hosting. In local development, images upload and display correctly using Storage::disk('public').
Here is my upload method in a trait:
public ...
1
vote
2
answers
182
views
Backend Laravel api and frontend vuejs works in dev but not in production on a shared hosting
I am trying to deploy an application on a shared hosting (LWS).
My app uses Laravel12 as a backend and Vuejs as frontend
The frontend is installed directly on the domain.fr and the backend on a ...
2
votes
1
answer
86
views
How to pass along waitForExpression argument when using gotenberg-php
A PDF is being generated using gotenberg-pdf client (in a Laravel webapp), communicating with the API on the same server (localhost:3000). I would like to pass along the waitForExpression argument as ...
0
votes
0
answers
57
views
Hide the stripe details passed to view in laravel
I am using stripe for payment purposes. Here the thing is that I am passing my stripe key and oauth token to the view in following way:
The controller part
return view($filepath, [
'...
1
vote
1
answer
74
views
How can I enable Client Credentials grant to secure API endpoints?
I'm trying to enable Client Credentials grant to secure API endpoints. I want to create an API between a database and several websites (and SPAs) so I can monitor what website/SPA calls which ...
1
vote
0
answers
240
views
How can I install a new Laravel 12 project with Vue (Ziggy instead of Wayfinder)?
I want to set up a fresh Laravel 12 project that uses Vue.js for the frontend.
However, I don’t want to use the new Wayfinder package that comes with Laravel 12.
Instead, I’d like to configure it like ...
0
votes
0
answers
108
views
I got syntax error on installing typescript with laravel-data package
Reading https://spatie.be/docs/laravel-data/v4/advanced-usage/typescript docs
I try to add laravel data package on laravel/vue/element-plus site and adding app/Data/TaskAdminData.php class with code :
...
2
votes
1
answer
111
views
Assets not being loaded in Laravel 12 using storage:links
I´ve created a duplicate project of mine to upgrade from Laravel 10 to Laravel 12. As far as the PHP code, routes, and database everything went well as expected.
Yet, in my Laravel 10 project I had my ...
3
votes
1
answer
135
views
Getting 401 Unauthorized when calling Laravel Sanctum API after Inertia login (React + Laravel)
I'm using Laravel 11 with Jetstream (Inertia + React) and Sanctum for authentication.
Everything works fine when logging in via the default Inertia login page, but when I try to call a protected API ...
1
vote
0
answers
101
views
How to connect Xdebug to VSCode
I'm trying to use Xdebug in VSCode. It seems Xdebug is running but I can't get VSCode to hit on the breakpoints I set. In the logfile (see below) it shows some kind of mismatch between files in which ...
0
votes
1
answer
67
views
Rewrite URL on shared hosting Laravel [closed]
I currently have my Laravel project accessible via the URL:
https://URLXX.com/dev/public/
I’d like to access it directly using:
https://URLXX.com/dev
The same setup should also work for my staging and ...
0
votes
2
answers
63
views
Why collect method of Spatie\LaravelData\Data raised error with missing fields?
On laravel site I have a table with migration:
public function up(): void
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->foreignId('creator_id')...
-1
votes
1
answer
67
views
Arr::arrayToObject in Laravel 12
In laravel 9.0 this code worked well and then I could use $result->property syntax in my blade view instead of array syntax $result['property']
public function getAllWithPaginator($perPage = ...
0
votes
0
answers
54
views
How selecting some select option element to run filtered request on server?
On Laravel/Vue/Element Plus, site I make filter with some filters in control and in table of Vue file :
class TaskController extends Controller
{
public function __construct()
{
}
/**...
1
vote
0
answers
66
views
Error: Module '"vue"' has no exported member 'ref', 'computed'. etc
Does anyone experience this issue? I have laravel + vue 3 project and I recently use typescript. I installed these,
"typescript": "^5.9.3",
"vue-tsc": "^2.2.12"
...
3
votes
1
answer
83
views
In Laravel’s Repository pattern, should I pass an Eloquent model (User $user) or a DTO to keep it framework-agnostic?
I’m refactoring my Laravel application to follow a clean architecture approach with clear separation of concerns:
Controller → Service → Repository
The Controller handles the HTTP layer,the Service ...
0
votes
1
answer
57
views
Pass env variable from playwright test script to laravel controller method
I am running a store() method in which I have to create a project using playwright tests. My playwright index.spec.ts file where I am calling create project is:
import { test } from '@playwright/test';...
1
vote
1
answer
136
views
Laravel Vite still references old build files after running npm run build again
I’m using Laravel + React + Vite, deployed on shared hosting.
The problem is that Laravel keeps referencing old build files (e.g. old hash names in public/build/assets) even after I run npm run build ...
0
votes
1
answer
146
views
Is there a way in Laravel to bulk-insert multiple records and get Eloquent models (all inserted fields) returned? [duplicate]
I have a scenario where I need to insert multiple records at once.
I want to achieve all two:
Bulk insert multiple records at once (performance).
Return Eloquent model instances for the inserted ...
2
votes
1
answer
139
views
How can I append a calculated value to a pivot class at runtime?
I have an Order model that has a many-to-many relation to the Product model:
class Order extends Model
{
//...
public function products(): BelongsToMany
{
return $this->...
1
vote
2
answers
224
views
How can I use a dynamic custom 404 template in Laravel?
I am making a Laravel 8 application that supports themes. The active theme is set in the settings table and the parent controller reads it from there:
class FrontendController extends Controller
{
...
3
votes
0
answers
101
views
Implicit model binding fails when using {locale} prefix in routes
I'm working on a multilingual Laravel 12 app. All my routes are grouped under a {locale} prefix, like this:
Route::prefix('{locale}')
->group(function () {
Route::get('/activities/{...
0
votes
1
answer
92
views
Testing Eloquent model events in Laravel 11
I can't seem to find a definitive answer on how to test the following boot methods using PHPUnit tests in Laravel.
I'm referring to the mthods in public static function boot() on a model.
Survey model ...
0
votes
1
answer
79
views
Defining a BelongsToMany relation with an additional where clause
I have a belongs to many relation between two tables via a pivot table. But the business dictates that the relation needs an additional WHERE clause connecting the first with the last table.
table_a ...
1
vote
2
answers
57
views
Laravel + MongoDB: Update nested value in Model
I have Model with a deeply nested attribute:
$model = Model::create();
$model->nested_prop = ['foo' => ['bar' => ['x' => 1]]];
$model->save();
In another method I want to modify a ...
0
votes
0
answers
129
views
Laravel PHPUnit test: Multiple databases issue
In my Laravel application, I have set up two databases in a single server. All specific migrations and model classes have $connection property set up to use blog instance. The app works fine, no ...
1
vote
0
answers
45
views
Show only failing and expected values from PHPUnit output
I have PHPUnit tests that use data providers as inputs, and by default these are outputted in a diff-like format (when running with php artisan test):
1) Tests\Feature\MyTest::test_feature with data ...
0
votes
0
answers
45
views
How to register a JS code in filament 3.x?
Filament::script() does not exists in Filament 3.x and Js::make() to register assets in FilamentAsset only takes a file path. But I have a small script that I want to register on a Forms\Components\...
0
votes
1
answer
73
views
How can I set Redis key prefixes for sessions, cache, and queues separately in Laravel 12 (PHP 8.4)?
We’re running a Laravel 12 application (PHP 8.4) using Redis for sessions, cache, and queues — all within a single Redis database.
'redis' => [
'client' => 'phpredis',
'options' => [
...
0
votes
0
answers
98
views
Laravel Queue Process Slow
I hope you’re all doing well. I’m reaching out because I’m facing an issue with my setup. I have a .NET application and a Laravel system integrated via API. The .NET application sends payloads to the ...
0
votes
0
answers
33
views
Custom WebSocket Handler not firing or logging in Laravel BeyondCode (no HTTP request used)
I’m trying to implement a custom WebSocket handler in Laravel using BeyondCode Laravel WebSockets. My goal is to handle messages sent via ws.send from the frontend without any HTTP request.
Here’s ...
0
votes
1
answer
52
views
deploying a worker applcation using openshift [closed]
I'm very new to OpenShift and I'll soon be switching to it as my employer looks to consolidate our deploy processes to one tool.
The application I work on is unique to the rest of the other apps we ...
3
votes
1
answer
225
views
Is there a good way to gracefully handle bad method calls in Livewire?
I'm making most of my components extend from an abstract class where I register some exception handling using the exception lifecycle hook:
use App\Livewire\BaseComponent;
class MyComponent extends ...
2
votes
0
answers
58
views
Permission 'cloudmessaging.messages.create' denied on resource '//cloudresourcemanager.googleapis.com/projects/xxxxx' (or it may not exist)
I'm encountering a permission error when calling the Firebase Cloud Messaging (FCM) API for notifications. While the API retrieves details and generates a Firebase token successfully, the response ...
2
votes
0
answers
58
views
How to properly handle native JavaScript confirm() in Laravel Dusk without triggering UnexpectedAlertOpenException
I’m writing a Laravel Dusk browser test for a “Delete Contact” button that shows a native JavaScript confirm() dialog before deleting a record.
However, every time the test runs, I get this error:
...
1
vote
1
answer
57
views
Save button in Laravel Blade + JavaScript fetch not triggering (no console log, no network request)
I’m working on a Laravel Blade view (monitoring.blade.php) where I have an edit and save button for each row. The edit button works, but when I click the save button, nothing happens — no console logs,...
0
votes
1
answer
79
views
'php artisan migrate' fails because cannot resolve name in podman-compose set-up
I try to run a Laravel Vue.js application in container for production only. After launching
podman-compose up -d
I connect to the backend container (brew-backend) with:
podman run -it brew-backend /...
0
votes
0
answers
24
views
My Laravel 12 spatie laravel-medialibrary - ConversionHasBeenCompletedEvent was not fired in EventServiceProvider
I try to listen to ConversionHasBeenCompletedEvent to delete the original image after the conversion has been completed, but this event did not trigger in my listener.
I'm using spatie laravel-...
5
votes
1
answer
169
views
Set SQL Server LoginTimeout in Laravel
I've encountered a problem in my Laravel 12 project. I usually save my data in a remote SQL Server database, but I have to consider the case of a db server malfunction. I have a backup local ...
0
votes
1
answer
75
views
Laratrust role not updating until php artisan optimize:clear
I’m using Laravel 11 with Laratrust v8.3, and I’ve noticed something strange on my production server.
When I assign or update a user’s role, it doesn’t take effect immediately — the user still has the ...
0
votes
0
answers
73
views
Laravel 12 public and private key VAPID OpenSSl error
I'm trying to implement notifications on my system (with Laravel 12 and PHP 8.3.16) using composer require laravel-notification-channels/webpush. Everything installs correctly, but when running php ...