212,679 questions
0
votes
1
answer
51
views
Laravel 9 RefreshDatabase trait connects to wrong DB / user in GitHub Actions CI
I'm running Laravel 9 feature tests with the RefreshDatabase trait in GitHub Actions. Locally, everything works fine, but on CI, it seems that RefreshDatabase tries to connect with the wrong database ...
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 ...
0
votes
0
answers
62
views
Laravel 12 – Isolating queues per tenant in a multi-tenant SaaS (database driver)
I’m building a multi-tenant SaaS application with Laravel 12 using the database queue driver.
Problem
Each tenant should have its own isolated queue so that one tenant’s heavy background jobs don’t ...
0
votes
0
answers
138
views
I keep getting "Failed to open stream: Permission denied" and changing permissions on the folder does not work [duplicate]
I am switching from Windows to Linux (Fedora), and I keep getting this error in my Laravel project that I did not have on Windows:
Please, any ideas?
Update:
I have tried to do a clean install of ...
2
votes
0
answers
48
views
How can I use the input search in a different component using Algolia/Vue
I am using the infinite scroll with Vue 3 and InstantSearch(Algolia) but the
<ais-search-box placeholder="Search here…" class="searchbox" />
it should be in a different ...
0
votes
0
answers
39
views
Override `Illuminate\Mail\Mailer.php` send() method
I'm currently using Mailtrap to send test emails. I would like to override Illuminate\Mail\Mailer.php -> send() method. How can I do this in Laravel 12? This is what I have so far:
namespace App\...
0
votes
0
answers
30
views
Unisharp Laravel File Manager is giving a 403 Error
Using CKEditor (v4) and with the following code in my web.php file
Route::group(['prefix' => 'laravel-filemanager', 'middleware' => ['web', 'auth']], function () {
\UniSharp\...
0
votes
1
answer
83
views
How to handle queued jobs failing silently when using Redis with Laravel 10 Horizon?
I’m working on a Laravel 10 project that uses Redis as the queue driver with Horizon. I’ve noticed that sometimes my queued jobs don’t execute, and nothing shows up in the failed_jobs table either.
...
1
vote
1
answer
105
views
Why does my Register route keep returning 401 Unauthorized?
Frontend part kept popping 401 Unauthorized, so I switched to Postman to just test the API.
Just to mention I am using Sanctum for API auth.
It keeps throwing 401 error, but Register route is not ...
1
vote
1
answer
115
views
Upload File in Laravel project hosted on Laravel Cloud gives 404
I just got done building a project locally on Laravel and decided to move forward with the hosting on Laravel Cloud since the deployment is straightforward. In my application, I allow users to upload ...
2
votes
0
answers
121
views
Why does my queued job in Laravel 10 not execute after dispatch?
I have a fresh Laravel 10 app and I'm trying to test queues.
I created a job with php artisan make:job TestJob.
routes/web.php
Route::get('/test-job', function () {
\App\Jobs\TestJob::dispatch();
...
1
vote
1
answer
77
views
Send custom request headers in Mailchimp Marketing — PHP
I am creating a method and using a service class to send custom headers to the Mailchimp API. The custom headers which I need to send exactly are:
"Accept-Language" "en-US, en;q=0.9&...
0
votes
1
answer
65
views
Laravel Eloquent option for return null in hasOne/belongTo relation
Is there an elegant way to return null from one-to-one relation based on other model's field? Eg. I have ModelA with field1, $field2. Maybe raw joins suitable for that and could be used in relations? ...
0
votes
0
answers
85
views
Laravel blade mail data not rendered
I have a mail view named passwordReset.blade.php like this
<!DOCTYPE html>
<html>
<head>
<title>Wachtwoord Reset</title>
<style>
body {
...
2
votes
0
answers
104
views
How to fix “Class not found” error in Laravel 10 when running artisan command?
I’m working on a Laravel 10 project and ran into a Class not found error when executing an artisan command.
Goal: I want to create a custom artisan command that fetches data from the database.
Problem:...
0
votes
0
answers
94
views
Laravel reverb/echo useEchoPublic callback not triggering
I have a feeling I'm doing something very stupid but I cannot get the callback on useEchoPublic to fire no matter what I try
The event is structured like so, this is pulled straight from the browser ...
0
votes
0
answers
98
views
Laravel testing database table is being accessed by other users
I'm currently building a multi-tenant application using stancl/tenancy (every tenant uses their own database) in my Laravel application.
Whenever I'm writing tests, tests fail a lot due to the error
...
0
votes
0
answers
97
views
How to share HttpOnly cookie between Laravel API (localhost:8000) and Next.js (localhost:3000)?
I’m building an app where my backend is a Laravel API (running on http://localhost:8000) and my frontend is a Next.js 15 app (running on http://localhost:3000).
I want to store the Sanctum token ...
0
votes
0
answers
77
views
Laravel form submission not saving to database and file uploads not working
I am working on a scholarship management system using Laravel 12, Laravel Breeze, Blade, Tailwind, and MySQL. I created a multi-step applicant form with text fields and file uploads (passport photo, ...
0
votes
0
answers
29
views
Filament dynamic RichEditor field returns 'undefined' when creating a new record
I’m building a dynamic form in FilamentPHP where ContentType stores field definitions in JSON. I created a trait to map each field into a Filament component like this:
trait BuildsDynamicFields
{
...
1
vote
0
answers
55
views
How to add right margin to X-axis title in JpGraph?
Edit: I found the Answer
so if you want to center the title access the SetTitle() method on the x-axis and then in second param pass the position.
like this.
$graph->xaxis->SetTitle('Above Grade ...
1
vote
1
answer
89
views
How to access asset files when using Laravel and React with Inertia?
My app uses Laravel as backend, and React as a frontend solution with Inertia as intermediary.
The idea is to load .wav files from media storage (say /storage/app/audio) to let users playback phone ...
0
votes
0
answers
85
views
"Target class [livewire] does not exist" issue with laravel 10 only on production server
I have an issue with my code in production Heroku (running without problem locally).
I get the error Target class [livewire] does not exist
This is the code in my AppServiceProvider which triggers the ...
-2
votes
1
answer
64
views
How do i solve this database migration problem? [duplicate]
SQLSTATE[42501]: Insufficient privilege: 7 ERROR: permission denied for schema public at character 14 (Connection: pgsql, SQL: create table "migrations" ("id" serial not null ...
0
votes
0
answers
147
views
Laravel: Missing required parameter for
I need your help in finding the error. I got an error:
Missing required parameter for [Route: single-campaigns_user] [URI:
campaigns-user/campaign-single/{lang}/{cam_id}] [Missing parameter:
cam_id].
...
3
votes
0
answers
155
views
Laravel 12 Vue starter kit vite build error
After running the larael new command using the vue starter kit, I get the following:
failed to load config from C: \Users\rober\MyDocuments\www\tutorials\test123\vite.config.ts
error ...
2
votes
0
answers
83
views
supervisor creating logs file without the write permissions
We’re running some Laravel commands using Supervisor on our server. Each program writes to a log file in storage/logs.
The issue is that whenever a Supervisor rotates or creates a new log file, it’s ...
0
votes
1
answer
113
views
Is there any other approach to update or chunk to populate a new column with millions rows? [closed]
My query is taking too long to run when I use general filters, but it's fine with specific filters. I suspect it's an optimization issue.
To fix it, I'm trying to create a non-clustered index on a new ...
0
votes
0
answers
53
views
Generating APP_KEY for Laravel using AWS CDK Constructs
I'm trying to create the APP_KEY via AWS CDK but I don't think there is a relevant Construct to do this.
I tried this:
APP_KEY: ECSSecret.fromSecretsManager(
new Secret(...
1
vote
0
answers
75
views
Issue with Filament ModalTableSelect()'s multiple attribute
I am creating a Filament form using ModalTableSelect(). My current field configuration is:
ModalTableSelect::make('item_id')
->label('Item Code')
->placeholder('Click to select items')
->...
1
vote
0
answers
86
views
Livewire pagination with collections and calculated fields
I have an issue where I need to paginate an eloquent collection that has calculated fields, fields not in the database. Livewire's WithPagination trait only wants to be applied to an Eloquent query ...
0
votes
1
answer
240
views
File Upload via Livewire Returns 401 Unauthorized in Laravel (Nginx, Cloudflare)
I ran into an issue when trying to upload files using Livewire on my production server. The server responded with 401 Unauthorized.
My setup includes:
Cloudflare with Flexible SSL (Browser → ...
0
votes
1
answer
116
views
Laravel query existence of relationships
I need to check just existence of Laravel model relationships. Is there a loader similar to withCount? Eg
// with count
$authors = Author::withCount('books')->get();
foreach ($authors as $author) {
...
-1
votes
1
answer
119
views
Calculate the sum total of column values [duplicate]
I have a table in my blade page,
<table>
<thead>
<tr>
<th>Color</th>
<th>Total</th>
</tr>
</thead>
<tbody>
@if ...
2
votes
1
answer
531
views
Laravel Artisan Migrate fails with error TLS/SSL error: self-signed certificate in certificate chain
On my local development environment, I have Laravel running in a php:8.3-fpm container, connecting to MySQL in a mysql:8.0 container. After a recent rebuild, suddenly I can't complete artisan migrate ...
0
votes
1
answer
61
views
Laravel: Table name is misspelled in SQL statement [duplicate]
I've already written a web application with Laravel, but I'm not nearly as experienced yet. Therefore, I need to ask for help.
Platform: Laravel 12 Starter Kit LiveWire, PHP 8.2.12
Database: mariadb
...
0
votes
1
answer
53
views
Push event is not triggered in PWA using webpush
I have created a PWA from my Laravel + Inertia react app, I have a service-worker running that listens to push events. Whenever we register the service-worker initially we subscribe to the push event:
...
1
vote
2
answers
144
views
laravel 12 send email with multiple attachment from uploaded file fromStorage
I'm trying to send email in laravel 12 with upload file (multiple attachment) with subject and body from form submitting. my code looks like this
in frontend blade
<div class="container mt-4&...
0
votes
1
answer
181
views
404 on admin login page for Laravel Filament
I am using Filament 3. I can access the admin login page on my local project but not the production server (Heroku).
What I tried so far :
configure htaccess
add a procfile
canAccessPanels is ...
1
vote
1
answer
101
views
Laravel Reverb Curl Exception on Laravel Herd
I keep getting this error below
GuzzleHttp\Exception\RequestException: cURL error 1: Received HTTP/0.9 when not allowed (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://127.0.0.1:...
0
votes
0
answers
31
views
Laravel app hosted on cPanel showing raw PHP code instead of executing in live envirnment [duplicate]
I have deployed my Laravel application on a cPanel server under a subdomain. The app is hosted at:
Installer link (working fine): https://sns.sadistributor.com/public/install/
Main link (not working): ...
1
vote
1
answer
305
views
Flux UI modal close button not working in fresh Laravel 12 + Livewire project
I just created a fresh Laravel 12 project using the Livewire starter kit and added Flux UI.
Steps I followed:
laravel new my-app
# Selected starter kit:
> livewire
Then I followed the Flux UI ...
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 ...
0
votes
1
answer
134
views
Confusions with how Laravel's Job serialization and deserialization works
What happens to the model's eager-loaded relationship when the model is passed to another Job's dispatch method?
Context:
There is a job that retrieves all ongoing games and this job should create an ...
0
votes
0
answers
70
views
401 Unauthorized Error After Server Migration (Laravel + S3)
I’m using Laravel12 with Forge and Cloudflare, and Amazon S3 for storage. Recently, I migrated to a new server, and since then, I’ve been receiving a 401 Unauthorized response with:
{
"...
1
vote
0
answers
96
views
Where to call manual authorisation in Laravel 12?
I am starting a new project, which is updating an old website, there is a requirement to move the old user accounts and user data over to the new system, when a user logs into the new site for the ...
0
votes
0
answers
76
views
How to prevent direct access to /public folder in shared hosting with .htaccess?
I have a PHP project deployed on shared hosting, and my files are structured like this:
/public_html/
.htaccess
/public/
index.php
...
I want the site to be accessible from:
...
0
votes
0
answers
35
views
laravel 8 database connection error when resetting password for guard admin
i have a project for multi-users and one admin. my problem is when forget your password for guard admin. however the user web guard is work fine when i use forget your password. i use mailtrap as A ...
0
votes
1
answer
103
views
Flowbite library in Laravel [closed]
I would like to use the FlowBite library in my Laravel project, but I can't get it to work.
However, as you can see in image, the file input is not displayed correctly.
I followed to use this library ...
0
votes
1
answer
143
views
Filament upload file not moving image to destination folder
I'm using Filament 3.2 on Laravel 12, I just moved the project on a new server. On the old server this problem did not happen. That's the definition of the field
Forms\Components\FileUpload::make('...