Write beautiful and expressive tests for your Laravel applications using Pest PHP.

Pest is a modern testing framework for PHP that makes writing tests more enjoyable and readable.
Install Pest in your Laravel project:
composer require pestphp/pest --dev
composer require pestphp/pest-plugin-laravel --dev
php artisan pest:install
Pest uses a clean, expressive syntax:
it('can create a post', function () {
$response = post('/posts', [
'title' => 'My First Post',
'content' => 'Hello World',
]);
$response->assertCreated();
expect(Post::count())->toBe(1);
});
Understanding when to use each:
We'll also cover:
By the end, you'll write beautiful, maintainable tests for your Laravel applications.
Last updated on December 13, 2025