Faking HTTP requests in Laravel
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 section you can read posts I've written myself.
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?
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!
Stay up to date with all things Laravel, PHP, and JavaScript.
You can follow me on these platforms:
On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.
Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.
Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.
Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.
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.
Testing a Laravel project is one of the most pleasant experiences I've ever had: there's a clean testing API, a very powerful layer added on top of testing frameworks; all while keeping the simplicity and eloquence you'd expect from a Laravel project.
Original – – flareapp.io
At Flare, we launched a new search experience. We have a very cool search field with autocompletions (powered by the rendering engine behind VS Code), and a very smooth graph powered by AmCharts. Let's take a look at the technical details!
Read more [flareapp.io]
This edition of the meetup features those two excellent talks:
While recording videos for the Testing Laravel video course, I became a big fan of Pest, a test runner that tries to optimize the developer experience. I'm now using Pest as the default for testing new packages and projects.
I've also converted a couple of existing testsuites from PHPUnit to Pest. Luckily, this is a very easy process. In this video I'll show you how to get started. You'll see that it only takes a couple of minutes.
In this stream, Shruti Balasa show how powerful Tailwind is. She builds a simple dashboard layout in only a couple of minutes. If you want to learn more about Tailwind, consider buying a ticket for her online workshop at Full Stack Europe. You can get a 20% discount for Shruti's workshop by using…
Oh Dear is all-in-one solution to monitor your site that my buddy Mattias Geniar and I have created. It can monitoring uptime, certificates, broken links, scheduled jobs, and much more.
Under the hood, Oh Dear is a large Laravel application that performs many queries all of the time. To power future features, we've recently changed our database structure and refactored some pieces in our code base. We increased performance by decreasing the number of queries.
In this blog post, we'd like to to share some techniques that might be helpfull to increase the performance of your Laravel app too.
In this stream, Luke Downing shows us around in the source code of Pest parallel plugin he created.
We've created a new package that can render a beautiful support form widget on any page. You can read more about the package in this blog post at Flare.
In this stream, I'll show you how to use the package. We'll also source dive its code.
In this video, my colleague Brent explains a good way to test a form in a Laravel app.
This video is part of our new premium video course Testing Laravel.
In this stream, Brent and I showcase some cool techniques we use in our test suites.
In this stream, Pest creator Nuno Maduro explains how his testing tool works under the hood.
If you want to know how to use Pest (or PHPUnit) to test your application code, consider picking up our Testing Laravel video course.
Whenever something happens in one of your repos on GitHub, you can configure a webhook to be sent to your app. This way, you can perform some extra logic when a particular event occurs on the repo. A silly example would be to send someone a mail when an issue is opened.
We've created a new package called spatie/laravel-github-webhooks that makes it easy to consume GitHub webhooks in a Laravel app. In this blog post, I'd like to tell you all about it.
When reading technical blogpost around the web, you might have noticed that code highlighting is not always perfect.
Shiki is the code highlighter that uses the textmate parser VSCode uses under the hood. The code highlighting it provides is near perfect, even when using modern syntax. It supports 100+ languages (via our package Blade is supported too), and all VS Code themes.
I'm proud to announce that we have released three new Spatie packages that make it easy to use Shiki in your PHP projects:
We're already using this package to render all our documentation pages, our guidelines, and this very blog you are reading.
Our team has released a new Laravel package: spatie/laravel-artisan-dispatchable. This package allows you to dispatch any job from an artisan command.
In this blog post, I'd like to explain why we created the package and how you can use it.