PHPackages                             defstudio/pest-plugin-laravel-expectations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. defstudio/pest-plugin-laravel-expectations

ActiveLibrary[Framework](/categories/framework)

defstudio/pest-plugin-laravel-expectations
==========================================

A plugin to add laravel tailored expectations to Pest

v2.6.1(2mo ago)98548.9k—1.1%15[2 issues](https://github.com/defstudio/pest-plugin-laravel-expectations/issues)4MITPHPPHP ^8.1.0CI passing

Since Oct 3Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/defstudio/pest-plugin-laravel-expectations)[ Packagist](https://packagist.org/packages/defstudio/pest-plugin-laravel-expectations)[ GitHub Sponsors](https://github.com/defstudio)[ GitHub Sponsors](https://github.com/fabio-ivona)[ RSS](/packages/defstudio-pest-plugin-laravel-expectations/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (36)Versions (59)Used By (4)

[![Pest Laravel Expectations](https://camo.githubusercontent.com/1d76b3871d5cfa723e69761fdef2c1b78b208d12623b03310461fbbc4e06a7bf/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f506573742532304c61726176656c2532304578706563746174696f6e732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d2d2d6465762b64656673747564696f253246706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e73267061747465726e3d63697263756974426f617264267374796c653d7374796c655f32266465736372697074696f6e3d4c61726176656c2b7461696c6f7265642b253430706573747068702b6578706563746174696f6e73266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/1d76b3871d5cfa723e69761fdef2c1b78b208d12623b03310461fbbc4e06a7bf/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f506573742532304c61726176656c2532304578706563746174696f6e732e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d2d2d6465762b64656673747564696f253246706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e73267061747465726e3d63697263756974426f617264267374796c653d7374796c655f32266465736372697074696f6e3d4c61726176656c2b7461696c6f7265642b253430706573747068702b6578706563746174696f6e73266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d901caf3bbbc0306e69ecb1c0947d19d278ad050ae50040471153af0f33a98f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656673747564696f2f706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/defstudio/pest-plugin-laravel-expectations)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d3f19a3ae600e3b523118baeaec139011b0454d3c89af431f9ca1c7142297cf0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64656673747564696f2f706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e732f74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473)](https://github.com/defstudio/pest-plugin-laravel-expectations/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8daf9a12b414f8bd4997ccbddbaa3e5d6f71ca53a92d4f26feada0ea6ca88099/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64656673747564696f2f706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e732f7374617469632e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65)](https://github.com/defstudio/pest-plugin-laravel-expectations/actions?query=workflow%3A%22Static+Analysis%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/4cc82f85583f5e1a01a56e6cb1a8b6a216315f32086d0b3e9825dd14291d448d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656673747564696f2f706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/defstudio/pest-plugin-laravel-expectations)[![License](https://camo.githubusercontent.com/d266ada00691e9636f39df511855866372e2e0cfbb048845f03c6d404a440a25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64656673747564696f2f706573742d706c7567696e2d6c61726176656c2d6578706563746174696f6e73)](https://packagist.org/packages/defstudio/pest-plugin-laravel-expectations)[![Twitter Follow](https://camo.githubusercontent.com/693066b709807898103e87dd7be499e1ad0e773de86f7dc3037a98dbb7159db4/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f466162696f49766f6e613f6c6162656c3d466f6c6c6f77267374796c653d736f6369616c)](https://twitter.com/FabioIvona?ref_src=twsrc%5Etfw)

This [Pest](https://pestphp.com) plugin adds Laravel specific expectations to the testing ecosystem

```
it('can check model exists', function(){
  $user = User::factory()->create();

  expect($user)->toExist();
});
```

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require --dev defstudio/pest-plugin-laravel-11.expectations
```

The expectations added by this plugin are automatically loaded into Pest's expectation system. They can be used along other expectations.

Documentation
-------------

[](#documentation)

A full documentation with a detailed list of **available expectations** can be found at:

[https://docs.defstudio.it/pest-plugin-laravel-expectations](https://docs.defstudio.it/pest-plugin-laravel-expectations/)

Autocompletion
--------------

[](#autocompletion)

For PhpStorm users, a nice Plugin has been developed by [Oliver Nybroe](https://github.com/olivernybroe). It adds full autocompletion to ours Laravel Expectations, it is worth to take a look:

Changelog
---------

[](#changelog)

All notable changes to this project in our [changelog](https://defstudio.github.io/pest-plugin-laravel-expectations/changelog). For a full understanding of what changed and the PR that where merged, see also the [releases page](https://docs.defstudio.it/pest-plugin-laravel-expectations/community/releases)

The format is based on [Keep a Changelog](http://keepachangelog.com/)and this project adheres to [Semantic Versioning](http://semver.org/).

Credits
-------

[](#credits)

- [Fabio Ivona](https://github.com/fabio-ivona)
- [All Contributors](../../contributors)

Please see the [contributing guide](https://docs.defstudio.it/pest-plugin-laravel-expectations/community/contributing) for details on how to contribute to this plugin.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 90.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~94 days

Total

54

Last Release

74d ago

Major Versions

v0.0.6 → v1.0.02021-10-04

v1.12.2 → v2.0.02023-03-23

PHP version history (4 changes)v0.0.1PHP ^7.3 || ^8.0

v1.6.5PHP ^7.3 || ^8.0 || ^8.1

v1.12.0PHP ^7.3 | ^8.0

v2.0.0PHP ^8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/db5e0ab5568062368a52c61d67381c1a35be5e5c816968dd3883bc7ba2d46b53?d=identicon)[fabio.ivona](/maintainers/fabio.ivona)

---

Top Contributors

[![fabio-ivona](https://avatars.githubusercontent.com/u/8792274?v=4)](https://github.com/fabio-ivona "fabio-ivona (375 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![grantjanecek](https://avatars.githubusercontent.com/u/17169721?v=4)](https://github.com/grantjanecek "grantjanecek (7 commits)")[![JapSeyz](https://avatars.githubusercontent.com/u/2234034?v=4)](https://github.com/JapSeyz "JapSeyz (4 commits)")[![dr41d45](https://avatars.githubusercontent.com/u/47773787?v=4)](https://github.com/dr41d45 "dr41d45 (4 commits)")[![lakuapik](https://avatars.githubusercontent.com/u/20186786?v=4)](https://github.com/lakuapik "lakuapik (3 commits)")[![fsylum](https://avatars.githubusercontent.com/u/3433880?v=4)](https://github.com/fsylum "fsylum (2 commits)")[![tobz-nz](https://avatars.githubusercontent.com/u/443054?v=4)](https://github.com/tobz-nz "tobz-nz (1 commits)")[![edalzell](https://avatars.githubusercontent.com/u/6069653?v=4)](https://github.com/edalzell "edalzell (1 commits)")[![iMusicJJ](https://avatars.githubusercontent.com/u/57725397?v=4)](https://github.com/iMusicJJ "iMusicJJ (1 commits)")[![kblais](https://avatars.githubusercontent.com/u/1931954?v=4)](https://github.com/kblais "kblais (1 commits)")[![MarioGattolla](https://avatars.githubusercontent.com/u/94918437?v=4)](https://github.com/MarioGattolla "MarioGattolla (1 commits)")[![nicola-posa](https://avatars.githubusercontent.com/u/80521158?v=4)](https://github.com/nicola-posa "nicola-posa (1 commits)")[![ahoiroman](https://avatars.githubusercontent.com/u/23051150?v=4)](https://github.com/ahoiroman "ahoiroman (1 commits)")

---

Tags

expectationshacktoberfestlaravelpestpest-pluginphpplugintestingunitframeworktestpestlaravelexpectations

###  Code Quality

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/defstudio-pest-plugin-laravel-expectations/health.svg)

```
[![Health](https://phpackages.com/badges/defstudio-pest-plugin-laravel-expectations/health.svg)](https://phpackages.com/packages/defstudio-pest-plugin-laravel-expectations)
```

###  Alternatives

[pestphp/pest-plugin-drift

The Pest Drift Plugin

734.0M74](/packages/pestphp-pest-plugin-drift)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[jonpurvis/lawman

A PestPHP Plugin to help with architecture testing SaloonPHP integrations

4027.7k8](/packages/jonpurvis-lawman)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[milroyfraser/pest-plugin-gwt

Given When Then(GWT) Plugin for Pest

10332.1k1](/packages/milroyfraser-pest-plugin-gwt)[ozzie/pest-plugin-nest

Nest Pest PHP tests for better organization and readability

2028.3k](/packages/ozzie-pest-plugin-nest)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
