How to test that an Eloquent model actually exists original
In your tests, you might have used assertDatabaseHas to make sure that a model actual is persisted.
In your tests, you might have used assertDatabaseHas to make sure that a model actual is persisted.
– blog.frankdejonge.nl - submitted by Robin Dirksen
Bugs caused by race conditions can be a huge source or frustration. They are difficult to identify and often difficult to remedy.
Read more [blog.frankdejonge.nl]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
Chris Fidao wrote another excellent post on AWS.
Read more [laravel-news.com]
Here are a few best practices for working with a large tables.
Read more [42coders.com]
Here's the recording of the latest edition of the Laravel Worldwide meetup. Philo Hermans showed off two great Livewire packages that he made. Steve McDougall did a cool live coding session on how to build APIs. And at the end, our suprise guest Caneco gave a nice little presentation on Lumen as…
My current setup (end 2021 edition)
After tweeting out a screenshot, it often get questions around which editor, font or color scheme I'm using. Instead of replying to those questions individually I've decided to just write down the settings and apps that I'm using.
Here's how to use our spatie/simple-excel package to reate multi-worksheet files.
Read more [www.csrhymes.com]
In the vast majority of applications you work with data structures. Sometimes that data is described multiple times. Think for instance of a form request that tries to validate a blog post model, and an API transformer class for that same blog post model. Changes are that both classes describe the same properties.
Using our new laravel-data package, those structures only need to be described once.
The people at IconMap fetched the Tranco top 100,000 websites and analyzed their favicons
Read more [iconmap.io]
Liam Hammet explores the inner workings of Blade.
You will find all videos in this playlist on YouTube.
Have you ever had to write an API integration from scratch? Where you're managing the HTTP calls yourself instead of being able to rely on third-party packages?
In this video, which is part of the Testing Laravel video course, I explain the benefits of testing.
Read more [spatie.be]
- submitted by Mateus Guimarães
Mateus Guimaraes show a couple of neat tests powered by Pest.
Mocking, faking; these might sound like intimidating words if you don't know what they are about, but once you do, you'll be able to improve your testing skills significantly.
Part of "the art of testing" is being able to test code in some level of isolation to make sure a test suite is trustworthy and versatile. These topics are so important that we actually made five or six videos on them in our Testing Laravel course.
In this post, I want to share three ways how you can deal with mocking and faking. Let's dive in!
The newly released spatie/laravel-site-search package can crawl and index the content of one or more sites. You can think of it as a private Google search for your sites. Like most Spatie packages, it is highly customizable: you have total control over what content gets crawled and indexed.
To see the package in action, head over to the search page of this very blog.
In this post, I'd like to introduce the package to you and highlight some implementation and testing details. Let's dig in!
One of the things I really like about modern Laravel projects, are the new model factories introduced in Laravel 8.
Ray is an app we built at Spatie to make debugging your applications easier and faster. Being web developers, we naturally decided to write this app in Electron, which enabled us to move from nothing to a working prototype to a released product on 3 separate platforms within a matter of weeks.
A few days ago, a new version of 1Password was released that is able to detect where a user can reset his or her password.
A pretty interesting read by Kent on how he rebuilt his own site from scratch. Kent is mostly JavaScript focused, so it's good to get a perspective on which technolgies and solutions you choose with such a background.
The website certainly looks very good!
Read more [kentcdodds.com]
– doeken.org - submitted by Doeke Norg
In this post I want to introduce you to Tree structures. What they are, how you can use them, and in which situation they can be helpful.
Read more [doeken.org]