84 questions
0 votes
0 answers
39 views
How to add routes in laravel 12
Fresh new installation of Laravel 12 composer create-project --prefer-dist laravel/laravel api cd api composer update sudo chmod -R 775 storage sudo chown -R www-data:www-data storage sudo chmod -R ...
Best practices
0 votes
1 replies
30 views
Ignore parent Model Scope in a Child model
I have two models with global scopes. #[ScopedBy(UserScope::class)] class User {} #[ScopedBy(ViewerScope::class)] class Viewer extends User {} The scope just checks if class instance has is_viewer ==...
0 votes
0 answers
34 views
Is it possible to import an entire css folder to the Vite compilation in Laravel 12?
I am using the Laravel 12 + React starter kit, and I want to create several components, for example: app/resources/js/components/Navbar.tsx app/resources/js/components/Footer.tsx app/resources/js/...
0 votes
0 answers
20 views
Laravel 12 + React starter kit - what is the proper way to set the "dir" attribute in the HTML element? [duplicate]
Right now, I can set the lang attribute by changing the value of locale inside /config/app.php, but I also want to set the dir attribute. I can do something like that inside the /resources/views/app....
0 votes
1 answer
64 views
File not found when trying to display a background image from a CSS file
I have an svg file placed in /public/assets/icons, and I try to use it from within a CSS file: .some-icon { background-image: url("/assets/icons/arrow.svg"); } I get error 404 Not Found ...
Advice
0 votes
0 replies
46 views
How to properly build an HR Management System using Laravel (API) + Next.js (frontend) with token authentication and middleware?
I'm building an HR Management System using: Backend: Laravel Frontend: Next.js Authentication(SPA): Laravel Breeze (already set up for backend) I'm a beginner in Next.js, and I’m a bit stuck on how ...
Advice
0 votes
5 replies
129 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: ...
1 vote
2 answers
170 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 ...
0 votes
1 answer
74 views
How to run Artisan::call() method via Ajax when in maintenance mode
I have upgraded a Lravel 10 app to the latest Laravel 12.36.1. On the Laravel 10 app I have an Ajax call in the backoffice to put the project down or up that calls a method setMaintenanceMode(string $...
2 votes
1 answer
96 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 ...
2 votes
1 answer
136 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->...
3 votes
0 answers
95 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
53 views
Vite built .css file is not being used, page broken as old file is 404
I am using Ubuntu 24.04 and a LEMP stack and vite to host a Laravel 12 application. I am deploying with deployer and running npm run build on the server. Occasionally, I get hit with what seems to be ...
0 votes
1 answer
65 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
21 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-...