PHPackages                             krzysztofrewak/larahat - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. krzysztofrewak/larahat

ActiveLibrary[Testing &amp; Quality](/categories/testing)

krzysztofrewak/larahat
======================

Extremly simple Laravel Behat extension

v1.0.2(5y ago)41.2kMITPHPPHP ^7.4.4|^8.0CI failing

Since Apr 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/krzysztofrewak/larahat)[ Packagist](https://packagist.org/packages/krzysztofrewak/larahat)[ RSS](/packages/krzysztofrewak-larahat/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/44270326c6ae56fe0768612a99935f875d1b325e0141005b73c05509580d1ad7/68747470733a2f2f706f7365722e707567782e6f72672f6b727a79737a746f66726577616b2f6c6172616861742f762f737461626c65)](https://packagist.org/packages/krzysztofrewak/larahat) [![Total Downloads](https://camo.githubusercontent.com/00dc063c94562a2838eb901fe3071270898b060b3b223087098da7708680d06f/68747470733a2f2f706f7365722e707567782e6f72672f6b727a79737a746f66726577616b2f6c6172616861742f646f776e6c6f616473)](https://packagist.org/packages/krzysztofrewak/larahat) [![License](https://camo.githubusercontent.com/f3f6bcb1c04e7c0b1a34aae55ac03aa6797d614e9a4cb99f4137abb23d2e9427/68747470733a2f2f706f7365722e707567782e6f72672f6b727a79737a746f66726577616b2f6c6172616861742f6c6963656e7365)](https://packagist.org/packages/krzysztofrewak/larahat)

**Larahat** extension is an extremely simple way to start behaviour-driven development with **Lara**vel framework and Be**hat**.

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

[](#installation)

Just use composer, it will add required classes to your `vendor` directory at `Larahat` namespace:

```
composer require krzysztofrewak/larahat --dev

```

Usage
-----

[](#usage)

Locate your Behat configuration file (usually it's a `behat.yml`) and add `Larahat\BehatExtension` to your `extensions` list. You can also provide a custom `.env` filename via `env` variable, but by default it will be always `.env.behat`.

```
default:
  extensions:
    KrzysztofRewak\Larahat\BehatExtension:
      env: ".env.behat"
```

From now, in your context files you are able to use `app()` helper for retrieving your bootstrapped Laravel application. For example, you can handle requests directly into your application like that:

```
/**
 * @When :method request is sent to :endpoint endpoint
 * @param string $method
 * @param string $endpoint
 */
public function requestIsSentToEndpoint(string $method, string $endpoint): void
{
    $request = Request::create($endpoint, $method);
    app()->handle($request);
}
```

### Helpers

[](#helpers)

- `KrzysztofRewak\Larahat\Helpers\DisablingThrottling` trait added to your context helps with disabling throttling middleware;
- `KrzysztofRewak\Larahat\Helpers\RefreshDatabase` trait added to your context helps with refreshing database with every scenario;
- `KrzysztofRewak\Larahat\Helpers\SimpleRequesting` trait added to your context helps with sending requests and receiving responses from your application.

Development
-----------

[](#development)

You can use Composer in a container if you want to:

```
docker-compose run -w /application -u "$(id -u):$(id -g)" composer install

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~122 days

Total

3

Last Release

1986d ago

PHP version history (2 changes)v1.0.0PHP ^7.4.4

v1.0.2PHP ^7.4.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1510fdd451ceac1e63932de54f75090327040d34363b259221626fb185a7c613?d=identicon)[krzysztofrewak](/maintainers/krzysztofrewak)

---

Top Contributors

[![krzysztofrewak](https://avatars.githubusercontent.com/u/10898728?v=4)](https://github.com/krzysztofrewak "krzysztofrewak (10 commits)")

---

Tags

bddbehatbehat-extensionlaraveltesting

### Embed Badge

![Health badge](/badges/krzysztofrewak-larahat/health.svg)

```
[![Health](https://phpackages.com/badges/krzysztofrewak-larahat/health.svg)](https://phpackages.com/packages/krzysztofrewak-larahat)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M446](/packages/friends-of-behat-variadic-extension)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[soyuka/contexts

Behatch contexts

282.1M11](/packages/soyuka-contexts)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

50359.8k2](/packages/leanphp-behat-code-coverage)[drevops/behat-steps

Collection of steps for Behat

25381.7k3](/packages/drevops-behat-steps)

PHPackages © 2026

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