Browse Forum Podcast
All ThreadsLeaderboard
  1. Discussions

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

orest's avatar

remove fake notifications

In the majority of my tests in Dusk, I want to run Notification:fake() and in order to avoid writing it in every test file, I moved it to DuskTestCase abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; public function setUp(): void { parent::setUp(); Notification::fake(); } } However, there are few tests that I actually

orest's avatar
orest's avatar kevinbui8mos agoLaravel
5
1
Last reply by kevinbui 8mos ago
minaremonshaker's avatar

Differentiating One-to-One and One-to-Many Morph Relationships for User Uploads in Laravel

Suppose I have a single table and model for uploading all application files related to a users or any other model (like:posts etc...), including their profile picture and other documents. The profile picture uses a morphOne (one-to-one polymorphic) relationship, while the other documents use a morphMany (one-to-many polymorphic) relationship. In Laravel, how can I distinguish b

minaremonshaker's avatar
minaremonshaker's avatar Tray28mos agoEloquent
2
1
Last reply by Tray2 8mos ago
sumeetghimire's avatar

Laravel AI Orchestrator AI with Contextual Memory and Multi-Provider Support

Laravel AI Orchestrator is a Laravel package similar to prism, It supports multiple providers like OpenAI, Anthropic, Gemini, and Ollama with automatic fallback if one fails, structured outputs for clean data handling, and optional Contextual Memory that lets your AI remember previous conversations using cache or database. You can easily test and manage everything with built-i

sumeetghimire's avatar
sumeetghimire's avatar sumeetghim...8mos agoAI
2
1
Last reply by sumeetghimire 8mos ago
Darkdawg's avatar

Every translation helper has a broad return type?

I noticed the translation helpers __() and trans() return array|string|null. This means you cannot print/cast these to string without getting errors from PHPStan. Shouldn't Laravel come with at least a string return type translation helper out of the box? Or am I missing something?

Darkdawg's avatar
Darkdawg's avatar Darkdawg8mos agoLaravel
11
1
Last reply by Darkdawg 8mos ago
me108's avatar

Job fails silently on exception, nothing is logged

I have a weird issue with my Laravel 10 project on Windows 11. When a job throws an exception, Laravel just quits silently without logging anything to /storage/logs/laravel.log. It also ignores try-catch blocks and quits the execution nontheless. It wasn't always like that. It worked in the past. But I can't remember when it stopped and what I might have changed, except from ad

me108's avatar
me108's avatar me1088mos agoLaravel
5
4
Last reply by me108 8mos ago
naykel's avatar

How to prevent Choices.js from resetting on Livewire updates?

Hi all, I’m building a reusable multi-select component using Laravel Livewire 3, AlpineJS 3, and Choices.js. Individually, everything works fine — but when I combine them, the Choices instance resets every time the Livewire property updates. Most solutions I’ve found either suffer from the same issue or don’t work at all. From what I can tell, this is due to how Livewire reacti

naykel's avatar
naykel's avatar masokky8mos agoLivewire
5
1
Last reply by masokky 8mos ago
srushti_k's avatar

Laravel ZipArchive Cleanup Bug: Empty Folder Not Deleting After Zip Upload

Hey Laracasts community! I'm running into a frustrating issue in my Laravel app where, after uploading multiple documents, creating a ZIP file, and uploading it to cloud storage (DigitalOcean Spaces), the cleanup process isn't fully working. Specifically: The individual files get deleted. The ZIP file gets deleted. But the empty directory persists, even though scandir() claims

srushti_k's avatar
srushti_k's avatar srushti_k8mos agoLaravel
1
1
Last reply by srushti_k 8mos ago
Arigo's avatar

Login redirect problem

i developed a transcript management system solution which the signing up and loging in works like this. After signing up at the userside, the newly created account becomes diabled by default and would require validation from the admin before the user can login. after the validation using a toggle switch the user will be able to login successfully and it will take the user to t

Arigo's avatar
Arigo's avatar Arigo8mos agoFeedback
2
1
Last reply by Arigo 8mos ago
uluumbch's avatar

Custom validation class

I create a custom validation using Class that implements ValidationRule. it works perfectly, the problem is I can't use custom error message just like other laravel native rule. <?php namespace App\Rules; use Closure; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Validation\Validator; use Illuminate\Contracts\Validation\ValidatorAwareRule; use Illumina

uluumbch's avatar
uluumbch's avatar uluumbch8mos agoLaravel
4
1
Last reply by uluumbch 8mos ago
vincent15000's avatar

Cashier / Stripe / How to calculate automatically taxes ?

Hello, I have added Cashier::calculateTaxes(); in the AppServiceProvider. But sure it's not sufficient. I had a look at the documentation and it seems to be necessary to configure something. But it's quite difficult for me, because I don't know so much about taxes and it's the first time I really use Stripe and Cashier. The idea is : a french company will sell subscriptions to

vincent15000's avatar
vincent15000's avatar vincent150...8mos agoLaravel
3
1
Last reply by vincent15000 8mos ago
june23's avatar

Do E-Commerce Backend APIs need a lot more work than a clone of Twitter or Stackoverflow.com? In terms for Portfolio Projects.

I stumbled on a article not to long ago I think it was on Medium, and also have asked AI like Gemini for this answer, but I want to hear it from a professional who knows these kinds of things. My question is... Is it true that for Portfolio Projects, like E-Commerce Backend APIs (weather simple or complex) are more bulkier and a bit more harder to implement as opposed to a clon

june23's avatar
june23's avatar ian_h8mos agoGeneral
1
1
Last reply by ian_h 8mos ago
DanielRønfeldt's avatar

Force file downloads in Laravel + Inertia + Vue?

As the title says, I'm trying to figure out how to force file downloads in a Laravel 10 project running Inertia with the Vue 3 stack and the Composition API. The solution that LaryAI is suggesting involves using the Inertia.get() method, which is triggering an error saying that Inertia is not installed, which I believe is kinda silly since my whole project is Inertia-driven and

DanielRønfeldt's avatar
DanielRønfeldt's avatar gguio8mos agoInertia
6
1
Last reply by gguio 8mos ago
Samer_J's avatar

Class 'Tests/TestCase' not found when attempting to run test

Can't find a solution to this anywhere. I've simply followed along with the Laravel 5.4 docs in the "Testing: Getting Started" section. I created a new test using "make:test" and then executed "phpunit" from my terminal. This is the error message I get: PHP Fatal error: Class 'Tests\TestCase' not found in /home/vagrant/Projects/mgn/tests/Feature/T

Samer_J's avatar
Samer_J's avatar tinker8mos agoTesting
15
2
Last reply by tinker 8mos ago
Laudenz's avatar

Deploy my Laravel project to a production server

Hi everyone, I’m new to Laravel. I followed the beginner tutorial and built my first app using Herd locally. The framework feels great, but I’m struggling to deploy my project to a production server. Is there a step-by-step guide (or best practices) for publishing a Laravel app that was developed with Herd? Thanks in advance!

Laudenz's avatar
Laudenz's avatar Laudenz8mos agoLaravel
5
1
Last reply by Laudenz 8mos ago
MohammadAsadi's avatar

How to download apk file on laravel?

Hi I upload apk file on storage folder and Write this code on controller: $file = "/home/user/public_html/storage/app.apk"; return response()->file($file ,[ 'Content-Type'=>'application/vnd.android.package-archive', 'Content-Disposition'=> 'attachment; filename="app.apk"', ]) ; now download app but is zip file How to fix it?

MohammadAsadi's avatar
MohammadAsadi's avatar tenorjamal8mos agoLaravel
6
1
Last reply by tenorjamal 8mos ago
earmsby's avatar

2-way relationship in Filament?

I have a model called Contract. Contract has a many-to-many relationship with itself called relatedContracts. The pivot table for this has 2 fields: contract_id & related_contract_id. In my view for Contracts in Filament I have a relation manager called RelatedContractsRelationManager.php. This works fine if I am on the contract with the ID in the contract_id field -> it

earmsby's avatar
earmsby's avatar earmsby8mos agoFilament
3
1
Last reply by earmsby 8mos ago
CaptainJackas's avatar

npm run dev not compiling app.scss

Hi all, I just created a new Laravel project and I keep running into the following problem. Whenever I execute the npm run dev and I reload the page, it keeps loading and eventually the app.scss is returning ERR_EMPTY_RESPONSE after like 5 min, whereas the app.js is generated and loaded just fine. Funny thing is, when I reload the page and after that I hit q+enter in the comman

CaptainJackas's avatar
CaptainJackas's avatar CaptainJac...8mos agoVite
2
1
Last reply by CaptainJackas 8mos ago
phpMick's avatar

How are well all using AI?

I just thought I would start a discussion to see what other people are doing. I used to be a big fan of TDD but now I work differently: give AU (Augment currently) my requirements for one file (eg a model factory) write manual(ish) tests to confirm that the requirements have been met step through the tests with xdebug and bugfix as I go I really like this because the tests c

phpMick's avatar
phpMick's avatar phpMick8mos agoGeneral
0
1
SPresnac's avatar

HasOne relation with lowercase compare?

Hej, I do have a hasOne relation like this public function employee(): HasOne { return $this->hasOne( related: Employee::class, foreignKey: 'username', localKey: 'username', ); } Problem is: The "Employee" class is extern (like in an external DB, I do have only read access). Some Usernames are written

SPresnac's avatar
SPresnac's avatar martinbean8mos agoEloquent
4
1
Last reply by martinbean 8mos ago
LvckyAPI's avatar

Reverb is not receiving event

I am trying to build a real-time chat. So I need reverb to send the messages to everyone live without reloading the page. Problem is, that the MessageCreatedEvent was not received by reverb. Only th pusher ping is in the log. The queue is working and is dispatching the event correctly. REMIND: It's a docker compose setup, so vite has to be the real url and Reverb is internal re

LvckyAPI's avatar
LvckyAPI's avatar zfhassaan8mos agoReverb
9
1
Last reply by zfhassaan 8mos ago
ismail_bourbie's avatar

Boolean cast not converting string values on save.

I’ve hit a confusing behavior with Laravel’s native boolean cast. Here’s a minimal example: $user = User::first(); $user->test = 'on'; $user->save(); Model: protected function casts(): array { return [ 'test' => 'boolean', ]; } When saving, I get: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column 'test' Is this expected be

ismail_bourbie's avatar
ismail_bourbie's avatar havanaelon8mos agoEloquent
8
1
Last reply by havanaelon 8mos ago
anjanesh's avatar

Filament as a SaaS ?

So I was thinking of using Nova, which is a paid subscription as a backend for laravel - I knew about Filament but last time I checked, it was a simple backend. But now when I checked the filamentphp website it seems to be an ecosystem of its own ? What's this with "Multi-tenancy built for SaaS." ? We can have a full-blown SaaS suite using filamentphp with payment bat

anjanesh's avatar
anjanesh's avatar ayoolatj8mos agoFilament
2
1
Last reply by ayoolatj 8mos ago
minaremonshaker's avatar

why feature test are always slower that unit tests?

I’ve always wondered why feature tests, especially those that interact with databases, tend to be slower than unit tests. Is it because connecting to and retrieving data from the database adds extra overhead, or are there other factors involved?

minaremonshaker's avatar
minaremonshaker's avatar minaremons...8mos agoGeneral
3
1
Last reply by minaremonshaker 8mos ago
thesimons's avatar

Is it normal to get lost in your own Laravel project?

Hey everyone, This isn’t really a help request — more of a curiosity. I’m currently working on my first big project with Laravel, and sometimes I feel like I get a bit lost inside my own app — jumping between controllers, structures, and so on. Is that something everyone goes through at some point, or does it mean I’m doing something wrong in how I’m structuring things? Thanks,

thesimons's avatar
thesimons's avatar Glukinho8mos agoLaravel
11
1
Last reply by Glukinho 8mos ago
mikailfaruqali's avatar

Which is the best VPS hosting plan?

Hello sorry for this question . I want to buy a good host, I tried several places nothing good I would be grateful if you can recommend me a reliable place and have experience with it Some of the places I bought hosting from : 1.https://www.godaddy.com 2.https://www.hostinger.com 3.https://www.bluehost.com 4.https://www.mochahost.com

mikailfaruqali's avatar
mikailfaruqali's avatar monovm8mos agoLaravel
6
1
Last reply by monovm 8mos 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.