212,679 questions
2
votes
1
answer
254
views
How to disable laravel sanctum redirect to login page
How do I fix the standard behavior of laravel sanctum. I use sanctum for a SPA application.
I'm only interested in the backend component of the framework, without the blade pages.
Route::get('/...
-3
votes
1
answer
139
views
Vite manifest not found at: .../public/build/manifest.json but the manifest.json built in .../public/build/.vite/manifest.json
When running npm run dev that works but when I stop the npm run dev and run the npm run build then go to the web site, I get the error message:
Illuminate\Foundation\ViteManifestNotFoundException: ...
0
votes
0
answers
51
views
Making Macroable target an element in Spatie HTML
I'm following the Spatie instructions on extending their HTML class to make a component. So far so good:
return Label::create()->addChildren([
Span::create()->class('input-container')->...
0
votes
1
answer
87
views
Laravel Setup DB config with credentials stored on AWS service
for security reasons I have to store my DB credentials on AWS secret manager so, for this I use the app\Providers\AppServiceProvider.php to connect to aws service with this code
use GuzzleHttp\Client;...
1
vote
0
answers
86
views
Laravel nova dashboard custom logo not loading
I have a logo.svg in my public/images directory and want to use that as the new logo for my Laravel nova dashboard.
config/nova.php
'brand' => [
'logo' => public_path('images/logo.svg'),
],
...
0
votes
0
answers
74
views
How to run JavaScript only after Livewire finished updating the DOM?
I’m using Livewire 3.6.3 with a chart (ApexCharts).
On my Livewire component I dispatch an event:
$this->dispatch('update-chart', $this->report['chart_data']);
And in JS I listen to it:
...
3
votes
2
answers
145
views
How to use a background color validation when importing?
I want to import a file and rows can have background colors. So when a background color is found, then a validation needs to happen. But when I try to import it with the background colors and try to ...
1
vote
2
answers
131
views
Laravel 12 - Angular 20 - Sanctum SPA - CSRF Token mismatch
Im trying to build a login and create user with CSRF Tokens and it wont run i tried for 3 days now and it wont work because of CSRF token mismatch. i think im missing something small or idk if its a ...
0
votes
1
answer
104
views
Laravel Observer With Octane: slug is generated in creating event, but not saved in DB
I'm using a creating Eloquent model observer to automatically generate a slug before inserting a new product into the database.
Here’s the code from my ProductObserver:
public function creating(...
0
votes
0
answers
52
views
Laravel 12 + rappasoft package using pivot data
I have the following data model(equipment rental):
order(id,client_id,status),
equipment(id, title, rental_price, status, category_id).
equipment_unit(id, equipment_id, code)
order_items(order_id, ...
1
vote
0
answers
117
views
laravel reset password not resetting
I’m working on the laravel 12, on forgot-password functionality. In the forgot-password page, there is only an email field. When a user submits their email, an SMTP email is sent with a reset link. ...
0
votes
0
answers
37
views
Livewire PowerGrid: Initial `user_id` filter conflicts with typed `user_name` filter
I’m using Livewire PowerGrid and want to show only the current user’s records on initial load, but allow filtering by user name.
Datasource:
public function datasource(): Builder
{
return Worklog::...
0
votes
2
answers
121
views
Type error using Laravel 12 React starter kit
I am using the new Laravel 12 React Starter Kit. I have a table that displays customers, at the end of each row i have a button for resending email, but im getting some type error that i dont really ...
0
votes
1
answer
67
views
Laravel Echo Server not receiving broadcast events even though WebSocket connection is successful
I’m using Laravel 8 with Redis and laravel-echo-server to broadcast events to my frontend.
The WebSocket connection is successful (status 200), but the broadcasted event from Laravel never shows up in ...
0
votes
1
answer
54
views
Class \"Gloudemans\\Shoppingcart\\Facades\\Cart\" not found in hardevine/shoppingcart
I am working on a shopping cart with laravel 10 and I am using hardevine/shoppingcart for it. When doing the checkout the error
Class "Gloudemans\Shoppingcart\Facades\Cart" not found
...
2
votes
0
answers
154
views
Tenancy for Laravel - Global Users Table
I am using https://tenancyforlaravel.com/ on a fresh Laravel 12 application. I am having an issue with the users. I want all my users to reside in the central database only and not inside individual ...
2
votes
1
answer
78
views
How can I use VSCode IntelliSense for PHP and Laravel in Laradock?
I'm working on a Laravel project using Laradock. I do not have PHP installed locally. How can I get IntelliSense for PHP and Laravel to work in VSCode while using Laradock?
0
votes
1
answer
40
views
What causes the error "Invalid parameter number" when using union() function in Laravel model?
I can't understand what happened, it all worked before.
I have a model:
class MyModel extends Model
{
protected $table = 'table1';
use HasFactory;
public function rel()
{
return ...
1
vote
1
answer
97
views
Tinker isn't auto-resolving namespaces for classes
I have an old Laravel application that I work on (believe it was initialised back on Laravel 4), and for years I've never been able to get tinker to automatically resolve namespaces for classes like ...
1
vote
0
answers
151
views
Laravel using "log" broadcast driver/connection despite setting it to Pusher
I am trying to use Pusher as my broadcast driver by setting BROADCAST_CONNECTION=pusher in my .env file which is used as the default in my broadcasting.php file. However, whenever I go to print out ...
0
votes
2
answers
72
views
Using route(routeName) in Laravel 11
After I upgraded from Laravel 10 to Laravel 11 using Laravel shift tool I noticed a change using route(routeName) in my Vue3 templates.
Example:
<template>
<div>
{{ route('...
0
votes
2
answers
87
views
Select top users based on their Recipes popularity
I am trying to get the top of users and order them by popularity of their recipes
The popularity of a recipe is determined by the number of:
likes
dislikes
(likes and dislikes are stored in ...
1
vote
1
answer
71
views
How to configure Laravel Ratchet WebSocket + ZMQ host/port for local, development, and production environments?
I’m building a Laravel project that uses a WebSocket server with Ratchet and ZeroMQ (ZMQ) for broadcasting events.
In my local environment, the setup looks like this:
// App\Console\Commands\...
0
votes
0
answers
71
views
Translations re-render on page load
My translations on InertiaJS/React with i18next rerender when page fully loads, which ruins both SEO and animations. when page is initializing, first it loads the en language (even when I change the ...
1
vote
0
answers
81
views
Laravel RabbitMQ worker not processing batch
We are using a RabbitMQ worker (https://github.com/php-enqueue/enqueue-dev/tree/master) on our Laravel 11 system to process job batches. At the end of each job, it checks if any more jobs need adding ...
2
votes
2
answers
127
views
Upload file from Angular to Laravel not working
I need to upload files from Angular to my Laravel API, but my code does not work and I cannot find where is the problem.
user-edit.html (Angular):
<div class="form-group">
<...
0
votes
3
answers
322
views
DaisyUI theme not applying, always shows default theme in Laravel + Vite + TailwindCSS
I am working on a Laravel project with Vite, TailwindCSS, and DaisyUI.
I want to apply the "corporate" theme globally, but all DaisyUI components still appear with the default theme styling.
...
0
votes
0
answers
68
views
Cookies are missing from request when feature testing in Laravel
My project is using a modified implementation of Laravel Passport for authentication.
I have a route, /auth/login, which I use for authentication. POST is for logging in, PUT is for refreshing tokens, ...
0
votes
1
answer
77
views
Laravel: N+1. Each HomepageSection with type category calls getRecipes() and produces duplicate category/recipe queries
I have a homepage made of "sections" (HomepageSection). Each section can be one of: popular, latest, or category. For each section I call a getRecipes() method to get the recipes for that ...
0
votes
3
answers
136
views
Authenticated in web.php but not in api.php
I'm using Fortify and Sanctum to provide session based auth to my SPA.
In my development environment the SPA is on http://127.0.0.1:3000 and my Laravel app is on http://127.0.0.1:8000 and these are my ...
0
votes
1
answer
72
views
Does Ratchet WebSocket require Redis to broadcast messages from Laravel API, but not when the events sending directly from frontend?
I'm implementing a real-time stock opname (inventory check) feature using Laravel and Ratchet WebSocket.
I want to broadcast a message to all connected WebSocket clients when an API endpoint is hit, ...
0
votes
1
answer
96
views
Queued notification not delivering [closed]
I am trying to switch notifications to use queue. I have implemented the ShouldQueue interface and added the Queueable trait to the notification class.
No matter which QUEUE_CONNECTION I use, the job ...
1
vote
1
answer
100
views
VSCode WSL Laravel: configure Ignition or Ray to open files directly in VSC debugger
I am using VSCode on windows with WSL Linux where the project files are and PHP and the XDebug debugger are running. When Ray or Ignition display debug information with a filename, I would like the ...
2
votes
2
answers
95
views
Filamentphp adding demo mode middleware
I created an admin panel on Laravel with Filamentphp. I want to create a middleware for demo mode to block requests such as post, put, and delete. However, I couldn't do it.
demomodemiddleware.php
<...
0
votes
0
answers
83
views
GitHub Actions + Docker: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed
I'm setting up GitHub Actions for a Laravel project using Docker.
During the workflow run, I get the following error when Laravel tries to connect to the MySQL container:
SQLSTATE[HY000] [2002] ...
0
votes
3
answers
125
views
live commenting system with laravel and ajax
I want to implement a live commenting system for each post of my project
this is my view
@extends('layouts.main')
@section('content')
<p>{{ $post->title }}</p> // there is nothing ...
0
votes
1
answer
66
views
Logged in successfully, but all commands return "Your API Token is invalid"
With the Laravel Forge CLI forge login authenticates successfully. However, when I run any command afterward (e.g. forge servers:list or forge sites:list) I get:
Your API Token is invalid.
This ...
0
votes
0
answers
66
views
Uploaded images are not stored to google drive folder
I am using this package yaza/laravel-google-drive-storage because I want to use google drive as storage for the uploaded images. The uploading is successful but the problem is the images are not ...
0
votes
0
answers
56
views
i want to use reverb but when i try to composer install for fresh below error occuerd [duplicate]
This thing happend when I try to clone the same from git and installing the composer
Pusher\Pusher::__construct(): Argument #1 ($auth_key) must be of type string, null given, called in /Users/...
0
votes
1
answer
85
views
global scopes for get , all and paginate function in laravel
I write a trait in laravel named prioritiable and I add a global scope to the query to sort the query result based on priority value
The problem is the scope add the order by SQL clause to all SELECT, ...
1
vote
1
answer
189
views
Filament filter on another table column
I've searched for this answer but didn't find any, so I'm here to ask. I'm using Filament 3.2 on Laravel 12. I have a RelationManager based on a table tournament_players that has a relation on players ...
-1
votes
2
answers
128
views
Internal Server Error Illuminate\Contracts\Container\BindingResolutionException Target class [admin] does not exist
I'm having this error that I can't seem to resolve. I'm making a Laravel application in PHP.
The routes in the web.php file are correct. There are no errors in the controller, nor in the kernel.php ...
1
vote
2
answers
81
views
Unable to validate reCAPTCHA in Laravel Jetstream with Inertia.js during login
Jetstream Version
4.0
Jetstream Stack
Inertia
Laravel Version
10.10
PHP Version
8.1
I am implementing Google RECAPTCHA v3 in Jetstream login. But its fails because inertia Jetstream auth sending 2 ...
0
votes
2
answers
89
views
How to get inserted model or collection when using fillAndInsert which just returns a boolean?
$transactionsData is an array, and I want the id from transaction id from the transaction model for each item and assign it to the details to insert the id to the transaction item table, how can I ...
-2
votes
2
answers
132
views
Json response not rendering to html table, only shows raw json data [closed]
I am returning json response from index method of my controller class.
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Admin\Services\Finish;
class FinishController ...
1
vote
1
answer
123
views
storage:link not creating symlink in public folder
I'm working on a Laravel 12 project using XAMPP on Windows 10.
I tried to use the following command to create the symbolic link for serving uploaded files:
php artisan storage:link
But the public/...
0
votes
1
answer
92
views
How to save PayPal details for the future payment same like card in Stripe session checkout page?
I'm using Stripe Checkout Session for the payment in my laravel project. I've included code like while creating checkout session:
'saved_payment_method_options' => ['payment_method_save' => '...
0
votes
2
answers
155
views
Laravel 12.x, subdomain and Mail::send() error
I'm developing an application where the admin section is accessible via a subdomain like admin.mysite.test.
Everything works fine except sending emails with login credentials for users manually added ...
4
votes
1
answer
631
views
Laravel 12 Sanctum + React Vite blocked by CORS policy
I created an app using Laravel 12 + Sanctum and React.
Locally in my laptop my app is working properly then I upload it to a Windows Server (IIS). With the same port 5173 of React and port 82 for the ...
1
vote
2
answers
176
views
How to work with Vite in Laravel during development?
I am using php artisan serve server, and when adding via resources @vite(['resources/js/test.js]), I get an error: Unable to locate file in Vite manifest: resources/js/test.js.
The vite.config.js file ...