Support the ongoing development of Laravel.io →
pickupman

pickupman

Joined 20 Feb 2014

Statistics

Threads 1
Replies 52
Solutions 8
Articles 0
posted 9 years ago

L5.3 Unit Testing with FindOrFail ModelNotFoundException

I am writing a unit test for a route passing a $id and have a ModelNotFoundException being thrown. I...

0 Likes
0 Replies
replied 11 years ago

Passing multiple db variables from Controller to View

You would setup your Comments table to have a post_id column. That would be your key. Then you would...

0 Likes
replied 11 years ago

Model::find($id) is being called 2 times to get related records

You are fetching the same data twice by using the find() in both lines. You could just use the query...

0 Likes

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2026 Laravel.io - All rights reserved.