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 3w ago

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

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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

2038d ago

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

v1.0.2PHP ^7.4.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10898728?v=4)[Krzysztof Rewak](/maintainers/krzysztofrewak)[@krzysztofrewak](https://github.com/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

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.4k](/packages/symfony-security-bundle)[symfony/security-http

Symfony Security Component - HTTP Integration

1.7k177.2M383](/packages/symfony-security-http)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)

PHPackages © 2026

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