87 questions
2 votes
1 answer
66 views
How can ship multiple different sources for the laravel-vite-plugin besides app.js?
Currently the app has 2 entry points for the JS and CSS files in the blade layout file: {{-- layout.blade.php --}} <head> <meta charset="utf-8" /> <meta name="...
-1 votes
0 answers
92 views
How to authenticate API routes in Laravel 12 using Sanctum [closed]
I have a route which I wish to protect with a token, using Sanctum. The offending route is /status, which would be accessed by /api/status. The /foo route works fine, there is only a problem when ...
0 votes
1 answer
106 views
Bug with @foreach loop in Laravel 12.x + Livewire 3.6
I am using Laravel v12 with Filament v4 and TailwindCSS v4. I wanted to build a site with tabs, witch are a Livewire component inside filament/Page. In this Livewire components I have 3 tabs, where ...
0 votes
1 answer
85 views
How to add routes in laravel 12 [closed]
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
37 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
37 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
21 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
66 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
48 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
154 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
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 ...
0 votes
1 answer
84 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
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 ...
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->...
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/{...