514 questions
3
votes
1
answer
36
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
0
answers
54
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
0
answers
57
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 ...
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 ...
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($...
-1
votes
1
answer
760
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, '...
1
vote
2
answers
98
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
1
answer
43
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() ...
0
votes
0
answers
69
views
Laravel + Vue.js Error: "Module not found: Error: Can't resolve './vue/app'"
I am using laravel 11 with Vite.config.
I am trying to add Vue.js to my project.
The instructions say that I must do this in my app.js
import "./bootstrap";
import { createApp } from "...
0
votes
0
answers
33
views
laravel-debuger does not show a few tabs in laravel 11
I have made a upgrade from laravel 10 to laravel 11 but suddenly the laravel-debugger does not show all the tabs.
To solve the problem I deleted the vendor map and composer.lock file and ran composer ...
0
votes
0
answers
105
views
Pusher is not a constructor after npm run build with Vite, Laravel Echo, and Pusher-js
I'm using Vite, Laravel Echo, and Pusher-js in my Laravel + Vue 3 project. My setup works perfectly in development with npm run dev, but after running npm run build, I get the following error in the ...
0
votes
4
answers
164
views
Livewire 3.6.10 with Laravel 11: wire:model not binding input value after page refresh
I'm working with Laravel 11, Livewire 3.6.10, and Alpine.js (properly configured). I'm encountering an issue where wire:model doesn't bind the value to an input field after a page refresh, even though ...
1
vote
1
answer
174
views
Laravel Scramble generate docs for https routes not working
I have Laravel 11.x app developing on Github Codespaces. I am trying to generate the documentation using Scramble package.
Github Codespaces publish urls are using https.
I am using api_domain entry ...
1
vote
1
answer
54
views
Importing node_modules from a dedicated Node.js project
I am currently Using Laravel 10 (I know it's outdated and I will upgrade asap), and I have node_modules folder inside the project because i installed some npm modules that I need.
But I need to move ...
0
votes
1
answer
78
views
Laravel Dependency Injection running before Middleware
I was under the impression that middleware runs BEFORE the route functions it wraps around.
Route::middleware([MyMiddleware::class])->group(function() {
// routess
});
But if one of the routes ...
1
vote
1
answer
275
views
Issue after Upgrading to Laravel 11: Undefined array key “driver”
I followed all the upgrade guide requirements, but when I run php artisan, I get the following error:
Undefined array key "driver"
at vendor/laravel/framework/src/Illuminate/Filesystem/...
0
votes
1
answer
173
views
Laravel 11 - how to call the old 'Handler.php' class from app.php - withExceptions
I have recently created a new project in Laravel 11 and can not get my custom error handling class to work. I have a class I use throughout all my Larvael projects (laravel 10). I want to use this ...
0
votes
0
answers
77
views
Crawling a page in Laravel 11 with spatie browsershot works from command but not directly from url in server
I have set a crawling command that works in local as well as in live using Laravel 11 and spatie browsershot. But when running directly from a url and cron in server following error occurs. I am using ...
0
votes
0
answers
42
views
Log messages to file present tenant's directory when using tenancy for laravel (Stancl/tenancy)
I am using Tenancy for Laravel (Stancl/Tenancy), Laravel 11, package. Everything working well. I want to know how to supply name of channel as a variable to log messages in the tenant's folder using ...
1
vote
0
answers
57
views
How do I make traits share conflicting methods and properties in PHP
I have this trait
HasExtendedRoles.php
trait HasExtendedRoles
{
use HasRoles;
use HasExtendedPermissions {
HasExtendedPermissions::getPermissionClass insteadof HasRoles;
...
1
vote
0
answers
68
views
Laravel seeder only inserting one record; should insert 2500
I have a Laravel seeder that is only inserting one record when I have a factory and the seeder should insert 2500 records.
Factory:
public function definition(): array
{
$timestamp = $...
0
votes
0
answers
63
views
Inertia Js , React Problem To Handle Laravel Returned Errors
ok, I've been using inertiaJs for a little over 1 year, only it's as if
inertia can no longer receive data from the backend.
for example, here's the simple authentification form I send:
const ...
0
votes
0
answers
110
views
Struggling to print using thermal printer via laravel
I'm using an XP-246B thermal printer. I have shared the printer and ensured that its name doesn't contain any whitespace. Also, I ran a test through Windows built in test page, and it was successful.
...
1
vote
0
answers
18
views
Laravel route returning "No response data for this request" when accessing an image file
I'm working on a Laravel application where I need to serve images stored in the filesystem and display them on a web page. I have defined the following route in web.php:
Route::post('/image/{campaign}/...
0
votes
1
answer
100
views
Multilingualism in Laravel 11
I am working on multilingualism using the mcamara library
This is what I did:
In the laravellocalization.php file
I activated the Arabic and English languages
In the boostrab/app.php file, I added the ...