Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

3rgo's avatar

Parallel testing with multiple database connections

Hi ! I'm currently working on an API that needs to have multiple database connections. At the moment it uses : 1 MySQL + 1 PostgreSQL + 1 MongoDB. MySQL and PostgreSQL may be merged in the future, but it will at least keep a MongoDB in parallel of the PostgreSQL. Connection to MongoDB is handled by the jenssegers/mongodb package This API is tested with Pest, but the current ~90

3rgo's avatar
3rgo's avatar Čamo7mos agoTesting
7
10
Last reply by Čamo 7mos ago
FireBlade's avatar

Delete Model Livewire Component

I have a Livewire component that deletes models : ... public function setRecord($model,$recordId){ $this->resetDialog(); $this->model = $model; $this->recordId = $recordId; } ... setRecord is called from Blade template : ```php @if($canDelete) <x-jet-dropdown-link @click="Livewire.emit('setDeleteRecord','Post',{

FireBlade's avatar
FireBlade's avatar FireBlade7mos agoLivewire
7
1
Last reply by FireBlade 7mos ago
Darkdawg's avatar

Autocompletion for public/computed properties in Livewire views?

Looking for extensions/tips to improve my VS Code experience with Livewire 3/4 MFC/SFC. I'm currently using the MFC/class based approach, but what bugs me the most is that my views have zero knowledge of my classes, so whenever I reference any variable all I get is (global variable) $category even if this is defined as public Category $category in the class. Not sure if this is

Darkdawg's avatar
Darkdawg's avatar Darkdawg7mos agoLivewire
2
1
Last reply by Darkdawg 7mos ago
Gabotronix's avatar

getting 419 CSFR Token Mismatch on POST/PUT requests to unprotected api routes with axios

I have been getting this error for the last week on all my axios POST/PUT/DELETE requests (GET requests work properly) to my api routes, eventhough I'm not using sanctum or any middleware to protect these routes. I added the proper meta-tag to all my blade files: <meta name="csrf-token" content="{{ csrf_token() }}"> I'm attaching csrf token to all my

Gabotronix's avatar
Gabotronix's avatar Eimmaarose7mos agoGeneral
3
56
Last reply by Eimmaarose 7mos ago
n2fole00's avatar

Xdebug not running on Sail

Hi, I can't get xdebug working on Sail. I've followed the steps in the Laravel Sail docs and also tried this article https://iwasherefirst2.medium.com/how-to-set-up-xdebug-with-laravel-sail-a-complete-guide-98d6498b382a My launch.json is { "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug (Sail)", &q

n2fole00's avatar
n2fole00's avatar jlrdw7mos agoDevOps
1
1
Last reply by jlrdw 7mos ago
Ligonsker's avatar

Using the Laravel 12 + React starter kit, where is a good location to put React components CSS files?

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/components/Sidebar.tsx And I want each component to have its corresponding css file. I was thinking to have a components folder inside app/resources/css/, like so: app/resources/css/c

Ligonsker's avatar
Ligonsker's avatar JussiManni...7mos agoGeneral
3
1
Last reply by JussiMannisto 7mos ago
mkfizi-29935843's avatar

Laravel Fortify confirm 2FA doesn't throw error for invalid input

Hi, As per title, i'm using Fortify. During confirm 2FA step, my app doesn't return error message when user input wrong code. Below is my form <form method="POST" action="{{ url('/user/confirmed-two-factor-authentication') }}"> @csrf <div class="space-y-1 mt-4"> <x-label for="code">{{ __('Authentication C

mkfizi-29935843's avatar
mkfizi-29935843's avatar mkfizi-299...7mos agoLaravel
1
1
Last reply by mkfizi-29935843 7mos ago
vincent15000's avatar

Splide with a rolling window of 21 items

Hello, It's a project with Laravel and VueJS. I'm using Splide to display a carousel. To avoid to have too many requests, I'd like to load a window around the central item displayed on the screen. For example if I display the first item among 33, I want to display item 1 and also load the 10 previous and 10 next items. As it's the first one to display, I will load the items fro

vincent15000's avatar
vincent15000's avatar vincent150...7mos agoGeneral
0
1
Morph-UK's avatar

UK postcode validator

I built a UK postcode validator for Laravel. Designed to work with Laravel's form validation, but also works manually as a facade pattern. Features: Checks postcode against an external API Uses ONS and Ordnance Survey postcode data Determines postcode country Supports England, Wales, Scotland and Northern Ireland Supports the Isle of Man and the Channel Islands Falls back to r

Morph-UK's avatar
Morph-UK's avatar Morph-UK7mos agoLaravel
0
1
wim91's avatar

What is the best way to prepare a project for deploy?

Hi everyone. I'm starting my first Laravel project and I want to optimize it, specifically removing unnecessary modules that were useful during development but are unlikely to be used anymore. Could you tell me which packages I can definitely remove?

wim91's avatar
wim91's avatar aleahy7mos agoLaravel
4
1
Last reply by aleahy 7mos ago
Developer654079525's avatar

Foreign keys

Must foreign keys be constrained or would a simple unsignedBigInteger type suffice when defining relationships?

Developer654079525's avatar
Developer654079525's avatar bestmomo7mos agoLaravel
2
1
Last reply by bestmomo 7mos ago
shez1983's avatar

Dusk - asserting route path is returns 'route not defined'

$browser ->visit(route('posts.show', ['post' => $old->slug])) ->screenshot(1) ->assertRouteIs(route('posts.show', ['posts' => $old->slug])); so when i see screenshot, I can see dusk has gone to the url - ie correct screenshot.. however assertRoute is.. returns Route [http://laravel.test/posts/environment-neque-as-6914e1669609c] not defined.

shez1983's avatar
shez1983's avatar tykus7mos agoTesting
3
1
Last reply by tykus 7mos ago
reakky's avatar

Livewire auth logic disappeard?

Hey everyone, I recently created a new Laravel 12 project with Livewire starter kit (but without Volt). There used to be an auth directory right inside the App\Livewire folder. But somehow it is gone. Does anyone know where it is?

reakky's avatar
reakky's avatar reakky7mos agoCode Review
0
1
ahoi's avatar

Prevent redirection in Laravel 11 (API-only project)

Laravel 11 came with some kind of new project structure. And now I am facing a problem, which was never a problem to solve for me before: I don't want to redirect a user to /login if the user is not authenticated. In such a szenario, I am getting: Route [login] not defined which originates from vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:118 What

ahoi's avatar
ahoi's avatar smares7mos agoLaravel
4
2
Last reply by smares 7mos ago
siggi's avatar

get job Id from dispatch in controller

Hello everyone, we currently use laravel 8, and generate a "lock file" that generates an empty file so a "generating..." tile can be displayed in another app. As the job might take some time to be handled, we dispatched from the controller and generated a lock file there like $jobId = $this->dispatch(new ReportExportNew(auth()->user()->id, $serializ

siggi's avatar
siggi's avatar xmsi7mos agoLaravel
11
9
Last reply by xmsi 7mos ago
jaracas's avatar

Can Inertia be used like this? Lots of components that update frequently

I'm starting a new personal project that will have multiple (As many as 10, possibly more) components that need to be updated every 250-500ms with updated data, all the data is pretty lightweight but with 10 components doing it I have to wonder if it'd be better to just use Laravel as an API and poll the server myself with something like axios. For the record, my project is a P

jaracas's avatar
jaracas's avatar Eimmaarose7mos agoInertia
3
1
Last reply by Eimmaarose 7mos ago
BKristof's avatar

When do I *actually* need to restart Reverb?

I've been curious about something for a while now. On a live Laravel app, when does Reverb actually need to be restarted? The docs are pretty vague on this. Currently I am restarting it on every deployment, which causes some annoying cURL errors now and then, since there's a small window of downtime. So, does Reverb need to be restarted for code changes? Like, every time I want

BKristof's avatar
BKristof's avatar tykus7mos agoReverb
1
1
Last reply by tykus 7mos ago
Ligonsker's avatar

Laravel 12 + Vite - 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 (seen in devtools), but when I try to use the same path and image from within a Blade file as <img>, it works: <img src="/assets/icons/arrow.svg" alt="&quo

Ligonsker's avatar
Ligonsker's avatar tykus7mos agoCode Review
1
1
Last reply by tykus 7mos ago
jaspercreel's avatar

Eager loading a relationship returning empty

Hi all, Eager loading a many-to-many relationship with a "wherePivot" clause is making it empty, even though there is data. I can do this: $thing->relations; and there is data. But if I do this: $thing->load('relations'); it is empty. The relationship looks like this: public function relations() { return $this->belongsToMany(Relation::class)->withPivot

jaspercreel's avatar
jaspercreel's avatar Snapey7mos agoEloquent
2
3
Last reply by Snapey 7mos ago
SeanKimball's avatar

Scoped bindings on controllers using traits

OK - I have an application that has several models that can relate to several other types of models example Resources(files) can be related to an index, an account, a user etc. anything that is "resourceable" That becomes problematic in the respect that adding all the resource crud methods to every controller for a resourceable model is a lot of problematic duplicati

SeanKimball's avatar
SeanKimball's avatar SeanKimbal...7mos agoDesign
1
1
Last reply by SeanKimball 7mos ago
MossGuy's avatar

include Alpine object in Laravel with @vite()

Hello, I'm a junior developer learning about Laravel and Alpine and I ran into a problem with linking an alpine object to my view. context: I've imported alpine into my project via the terminal with: ./vendor/bin/sail npm install alpinejs Then I included the following code in my app.js: import Alpine from 'alpinejs'; window.Alpine = Alpine; Alpine.start(); In my js folder is a

MossGuy's avatar
MossGuy's avatar MossGuy7mos agoLaravel
7
1
Last reply by MossGuy 7mos ago
Cavalcantefilipe's avatar

laragon week

I'm thinking of buying Laracasts Forever and it's on sale during Laracasts Week, or should I keep waiting for Black Friday?

Cavalcantefilipe's avatar
Cavalcantefilipe's avatar Tray27mos agoTips
1
1
Last reply by Tray2 7mos ago
shaneomac's avatar

Laravel for Ecom

What is out there for building a custom ecom store on Laravel? I am curious if there is anything similar to MedusaJS but on Laravel/PHP. Has anyone built ecom on Laravel/PHP before?

shaneomac's avatar
shaneomac's avatar LaryAI7mos agoLaravel
1
2
Last reply by LaryAI 7mos ago
earmsby's avatar

change title of audits relation manager tab

I'm using owen-it / laravel-auditing along with TappNetwork / filament-auditing to show an audit trail on one or more resources in my Filament app. All is working well with basics of it, but I'd like to simply change the name of the tab from "audits" to "Audit Trail." It seems I should be able to simply add protected function getTableHeading(): ?string {

earmsby's avatar
earmsby's avatar LaryAI7mos agoFilament
1
1
Last reply by LaryAI 7mos ago
earmsby's avatar

Audit trail for attaching relation

I am using owen-it/laravel-auditing package to log audits on my Laravel/Filament app. It's working great for create, update, and delete operations on the Contract model. I'd like to add the ability to log attach and detach events for a relationship (files) on the model I have the audit trail set up for. Searching online I found a suggestion to add a relationship listener event

earmsby's avatar
earmsby's avatar earmsby7mos agoLaravel
3
7
Last reply by earmsby 7mos ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.