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

booni3's avatar

Retrieving a loaded relationship but do not hit database if missing

I have the relationship: public function collectionAddress(): BelongsTo { return $this->belongsTo(OrderAddress::class, 'collection_address_id'); } In some parts of my app, the relationship does not exist but I want to load in an object to use within the request. So I can do: $model->collectionAddress = new OrderAddress($data); This all works fine unt

booni3's avatar
booni3's avatar dogakorkma...2mos agoEloquent
4
1
Last reply by dogakorkmaz35 2mos ago
vincent15000's avatar

Sorting logic

Hello, I have a code which seems correct to reorder some steps, but the result is not good. I receive the right old and new index. The order in the database starts at 0, exactly like the index. public function sortSteps(Request $request, Quest $quest) { $oldOrder = $request->oldIndex; $newOrder = $request->newIndex; $step = Step::where('quest_id', $quest->

vincent15000's avatar
vincent15000's avatar vincent150...2mos agoCode Review
1
1
Last reply by vincent15000 2mos ago
sandraalmassri's avatar

Laravel Web App Notifications Only

I want to create a website that sends notifications for my friends who just needs to log in

sandraalmassri's avatar
sandraalmassri's avatar JussiManni...2mos agoLaravel
3
2
Last reply by JussiMannisto 2mos ago
Svennnn's avatar

Refresh a lazy island from outside the island

Following use case: I have a page-component that displays a lot of threads. Loading the threads takes a moment, so I wrapped that access to my #[Computed] public function threads() in an @island(name: 'threads', lazy: true) That way I can still render the rest of the layout. Including filters, which live outside the island in the same component. <x-stupid.button href

Svennnn's avatar
Svennnn's avatar Svennnn2mos agoLivewire
5
1
Last reply by Svennnn 2mos ago
FabienArr's avatar

Laravel Xampp and secure headers

Hello, I use Laravel 12 and Xampp in my local machine. I have configure it to work in SSL and I use this module for secure headers : https://github.com/bepsvpt/secure-headers The problem is that all is ok in production on our server hosting, but in local I have error of stylesheet not loeaded and problem with the debugbar. I use livewire too. Local errors : Refused to load the

FabienArr's avatar
FabienArr's avatar FabienArr2mos agoLaravel
5
1
Chron's avatar

Ziggyjs route not updating in Laravel + Vue + InertiaJs

I have a Component that has a render function. And I just can't make this to work, unless I hard reload the page. import { useSlots, h } from "vue"; const slots = useSlots(); const children = slots.collapseChild(); const renderFunc = () => { return children.map(child => { return h("li", { /*this one --->*/ active: child.props?.href ==

Chron's avatar
Chron's avatar vincent150...2mos agoVue
3
1
Last reply by vincent15000 2mos ago
vincent15000's avatar

Animation in cascade

Hello, I want to apply an animation in cascade on each mpa-game. <mpa-infinite-scroll data="games"> <div class="mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> <mpa-game v-for="(game, index) in props.games.data" :key="'game-'+game.id" :game="gam

vincent15000's avatar
vincent15000's avatar vincent150...2mos agoInertia
1
1
Developer654079525's avatar

Staging

Currently, we have several VMs in which we are developing apps. Haven't had the need for a staging segment yet. If a small shop is developing an app, do they really need a staging segment on their or client's website? If so, would it then become staging.example.com or example.com/staging? I am not sure on the mechanics so would kindly ask for some guidelines. For example, how a

Developer654079525's avatar
Developer654079525's avatar quintinmor...2mos agoLaravel
4
6
Last reply by quintinmorrow 2mos ago
prasadchinwal5's avatar

Laravel Vite configuration with Docker

I am using docker container to run laravel 9/10 application. When I create a new project and visit my app url https://xyz.com/app_name, the app works. Now I am trying to configure vite. Here is what my vite.config.js file looks like: import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import fs from 'fs'; const app_url = 'https://xyz.com/app_name';

prasadchinwal5's avatar
prasadchinwal5's avatar samuelaust...2mos agoVite
3
26
Last reply by samuelaustinudhedhe 2mos ago
earmsby's avatar

missing columns when adding Filament relation

I have a Model: Account and a Model: AccountNote. Account has a relationship: public function accountNotes(): HasMany { return $this->hasMany(AccountNote::class); } And AccountNote has this relationship: public function account(): BelongsTo { return $this->belongsTo(Account::class); } In my filament resource for Account, I have a relation

earmsby's avatar
earmsby's avatar LaryAI2mos agoFilament
1
6
Last reply by LaryAI 2mos ago
ethor88's avatar

Herd 502 Bad Gateway

I used to run Valet and successfully got Herd up and running. Since using Herd has been great, I decided to remove Valet from my Mac. I uninstalled Valet, but now I'm having issues getting my sites to pull up in the browser with Herd. I'm getting a 502 Bad Gateway error. To fix this, I have tried Uninstalling and re-installing herd Restarting my computer Running brew services

ethor88's avatar
ethor88's avatar issamlk2mos agoGeneral
8
7
Last reply by issamlk 2mos ago
earmsby's avatar

Change page title of relationship infolist

I have a relationship that has this table: public function table(Table $table): Table { return $table ->recordTitleAttribute('note_date') ->defaultSort('note_date', 'desc') ->columns([ TextColumn::make('note_date') ->label('Date') ->date(), Text

earmsby's avatar
earmsby's avatar earmsby2mos agoFilament
4
1
Last reply by earmsby 2mos ago
DanNeon's avatar

Changing name to first_name in profile.tsx gives weird warning

I've changed the [name] user variable and table column to [first_name], so that I can also add [surname] for better user comms. Most things have updated okay, but I can't work out why this change in the profile.tsx Input block defaultValue={auth.user.first_name} is giving this warning 'The expected type comes from property 'defaultValue' which is declared here on type 'Intrinsi

DanNeon's avatar
DanNeon's avatar vincent150...2mos agoReact
5
1
Last reply by vincent15000 2mos ago
vincent15000's avatar

Setup SSR

Hello, I have this problem with this import. import { renderToString } from 'vue/server-renderer' ✗ Build failed in 335ms error during build: Build failed with 1 error: [plugin vite-plugin-pwa:build] Error: Build failed with 1 error: [UNLOADABLE_DEPENDENCY] Error: Could not load vue/dist/vue.esm-bundler.js/server-renderer ╭─[ resources/js/ssr.js:48:32 ] │ 48 │ impor

vincent15000's avatar
vincent15000's avatar vincent150...2mos agoInertia
4
88
Last reply by vincent15000 2mos ago
jesse_orange_newable's avatar

Redirect issue

My Microsoft SSO login route (/login/ms) was returning a 200 OK with an HTML redirect page instead of a proper 302 response. This only started recently — the same code worked fine days ago, and a Laravel 11 app on the same server worked perfectly. The url is: https://mynewable.newable.dev/

jesse_orange_newable's avatar
jesse_orange_newable's avatar JussiManni...2mos agoAI
3
1
Last reply by JussiMannisto 2mos ago
vincent15000's avatar

Supervisor configuration

Hello, I'm using a supervisor on a VPS. First of all, I add the queue worker in the supervisor configuration. What should I add additionally to the supervisor ? For example is it necessary to add nginx, mariadb or other services to the supervisor ? Thanks for your advice. V

vincent15000's avatar
vincent15000's avatar JussiManni...2mos agoDevOps
1
1
Last reply by JussiMannisto 2mos ago
swagger's avatar

file_put_contents(...): failed to open stream: No such file or directory - Always this problem

I've tried everything and it seems I can't fix this problem. It seems that if I try to connect with multiple IPs (I guess it creates multiple session) I get the following error: file_put_contents(storage/framework/cache/data/52/55/52557bd14c017c25000a0012fa60d8a011764fb7): failed to open stream: No such file or directory If I manully check the folder "55" it doesn't

swagger's avatar
swagger's avatar bloodykhee...2mos agoGeneral
6
3
Last reply by bloodykheeng 2mos ago
devSSI's avatar

getKeyName in Laravel 10 causes issue in test when slug is primary key

I have been working on rest api and now I am working on some tests, but since I want to use slug on my model as primary key (usual setup with getKeyName) I have strange behaviour. For example for this create method: $modelInstance = Model::create([ 'title' => 'Old Title', 'slug' => Str::slug('Old Title'), 'description' => 'Old descri

devSSI's avatar
devSSI's avatar devSSI2mos agoLaravel
5
1
Last reply by devSSI 2mos ago
thefireescaper's avatar

Best table to use with Laravel

I'm looking for any advice on what able to use to present data on a Laravel site. Table needs the usual sort, filter etc. but also looking for ability to display graphics eg. Mini chart lines etc. I currently use rappasoft table https://rappasoft.com/docs/laravel-livewire-tables/v3/introduction It's ok but lacks flexibility with the graphical elements etc. Thank you

thefireescaper's avatar
thefireescaper's avatar rudiwer2mos agoLaravel
6
1
Last reply by rudiwer 2mos ago
bcs02123052's avatar

how to get all cache items by tag ?

Is there a way to get all the cache items by tag maybe like this // save the items in cache $banks = Bank::all(); foreach ($banks as $bank) { Cache::tags(['banks'])->put('bank_' . $bank->id, $bank, now()->addHours(1000)); } // the get items like this maybe $banks = Cache::tags("banks")->getAll();

bcs02123052's avatar
bcs02123052's avatar tobz.nz2mos agoLaravel
6
1
Last reply by tobz.nz 2mos ago
hyperanjeeta's avatar

Am I the only one who genuinely prefers on-prem over the cloud?

For years, my career was purely focused on on-prem infrastructure, mainly in Linux-based roles. I spent my days configuring OSs with Ansible and deploying them with Terraform using on-prem providers like vSphere and Proxmox. We hosted everything ourselves, and I really loved the feeling of actually owning those workloads. A few months ago, I took a new job at a company that hel

hyperanjeeta's avatar
hyperanjeeta's avatar jlrdw2mos agoDevOps
2
1
Last reply by jlrdw 2mos ago
hyperanjitha's avatar

Is Envoyer superfluous after the new Forge update?

I've been using Forge and Envoyer together for a while now and the setup has been great but just deployed a new site with Forge and notice it's doing the job of Envoyer now…? Am I missing something or can I retire Envoyer now and just deploy through Forge only?

hyperanjitha's avatar
hyperanjitha's avatar jlrdw2mos agoEnvoyer
1
1
Last reply by jlrdw 2mos ago
hermeneus's avatar

Laravel Vite: Assets blocked/Mixed Content issues in production environment

I'm hosting my App on an EC2-instance behind an Elastic Load Balancer which manages my SSL-Certificate. On this EC2-Instance my nginx-configuration is redirecting all http-Requests to https. I recently switched to Vite which caused me a lot of trouble. When I push my app to the server after calling npm run build my assets are blocked. In the browser console I get: Mixed Content

hermeneus's avatar
hermeneus's avatar meenachinm...2mos agoVite
24
725
Last reply by meenachinmay 2mos ago
SachinAgarwal's avatar

path too long error on windows 10

when I run the npm install on windows machine after setting up laravel I get the following error: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(308,5): error MSB3491: Could not write lines to file "R elease\obj\bufferutil\bufferutil.tlog\bufferutil.lastbuildstate". The specified path, file name, or both are too long. The fully qual

SachinAgarwal's avatar
SachinAgarwal's avatar jackyflint...2mos agoMix
31
2
Last reply by jackyflint211 2mos ago
laracoft's avatar

Gemini vs Claude with Boost?

Has anyone used both Gemini and Claude with Boost? Which is better and why?

laracoft's avatar
laracoft's avatar jlrdw2mos agoAI
5
1
Last reply by jlrdw 2mos 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.