PHPackages                             hesamrad/laravel-flashlight - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hesamrad/laravel-flashlight

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hesamrad/laravel-flashlight
===========================

A Laravel Package to Log Requests

v1.2.2(2y ago)142211MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Jan 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hesamzakerirad/laravel-flashlight)[ Packagist](https://packagist.org/packages/hesamrad/laravel-flashlight)[ Docs](https://github.com/hesamzakerirad/laravel-flashlight)[ RSS](/packages/hesamrad-laravel-flashlight/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

[![Flashlight Cover](https://raw.githubusercontent.com/hesamzakerirad/laravel-flashlight/master/media/cover.jpg "Flashlight Cover")](https://raw.githubusercontent.com/hesamzakerirad/laravel-flashlight/master/media/cover.jpg)

Laravel Flashlight
==================

[](#laravel-flashlight)

Laravel-Flashlight is a minimal package to log incoming requests to your application; it is highly customizable and easy to install.

How to install?
---------------

[](#how-to-install)

Take these steps to install Flashlight.

### Step #1

[](#step-1)

Install the package from Composer.

```
composer require hesamrad/laravel-flashlight
```

### Step #2

[](#step-2)

Publish congifuration file.

```
php artisan vendor:publish --provider="HesamRad\Flashlight\FlashlightServiceProvider" --tag="flashlight-config"
```

### Step #3

[](#step-3)

Publish migration file. (Only if you want to store logs inside your database.)

```
php artisan vendor:publish --provider="HesamRad\Flashlight\FlashlightServiceProvider" --tag="flashlight-migration"
```

### Step #4

[](#step-4)

Apply middleware on routes.

```
Route::middleware('flashlight')->group(function () {
    Route::get('/', [SomeController::class, 'index']);
});
```

And you're done!

Now every request that goes through Flashlight will be logged to be monitored later.

Note that all Flashlight logs are stored in `flashlight.log` file under `storage/logs`.

---

How to customize Flashlight?
----------------------------

[](#how-to-customize-flashlight)

### Kill Switch

[](#kill-switch)

If you wish to turn Flashlight on/off for a short time, you can do so by editing `enabled` key inside `flashlight.php` config file under `App/config`.

```
'enabled' => true
```

Note that by default Flashlight **is** enabled.

---

### Driver Option

[](#driver-option)

There are a number of drivers you can choose to log the incoming requests to your application. You could choose `file` or `database` which will respectively store log records in a local file or a database table. You can change the driver by editing `driver` key inside `flashlight.php` config file under `App/config`. (This value corresponds to an existing key inside `drivers` array.)

```
'driver' => 'file'
```

Note that Flashlight uses `file` driver as its default driver.

---

### HTTP Method Customization

[](#http-method-customization)

If you wish to customize HTTP methods to log, you can do so by editing `excluded_methods` array inside `flashlight.php` config file under `App/config`.

For example:

```
'excluded_methods' => [
    'put',
]
```

By doing this, all `PUT` requests are ignored by Flashlight.

Note that by default all HTTP method **are** logged by Flashlight.

---

### Log Request Headers

[](#log-request-headers)

If you wish to log request headers, you can do so by editing `log_headers` key inside `flashlight.php` config file under `App/config`.

```
'log_headers' => true
```

Note that by default request headers **are** logged by Flashlight.

---

### Log Request Body

[](#log-request-body)

If you wish to log request body, you can do so by editing `log_body` key inside `flashlight.php` config file under `App/config`.

```
'log_body' => true
```

Note that by default request body **is** logged by Flashlight.

---

### Request Parameters Customization

[](#request-parameters-customization)

If you wish to customize request parameters to log, you can do so by editing `excluded_parameters` array inside `flashlight.php` config file under `App/config`.

For example:

```
'excluded_parameters' => [
    'password',
    'password_confirmation',
]
```

By doing this, all specified parameters are ignored by Flashlight.

Note that by default `password` and `password_confirmation` parameters **are** ignored by Flashlight.

---

### URI Customization

[](#uri-customization)

If you wish to customize URIs to log, you can do so by editing `excluded_uris` array inside `flashlight.php` config file under `App/config`.

For example:

```
'excluded_uris' => [
    'admins*',
]
```

By doing this, all requests under `/admins` are ignored by Flashlight.

Note that by default all requests **are** logged by Flashlight.

---

### Log table getting too big?

[](#log-table-getting-too-big)

No problem! Flashlight comes with a prune command to remove old logs to maintain a lighter table inside your storage.

All you have to do, is to run `php artisan flashlight:prune` command to make this happen.

Note that by default value is 30 days; and Flashlight will remove anything older than that; so if you want to change this value to your liking, you can do so by editing `prune_period` array inside `flashlight.php` config file under `App/config`.

---

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

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 ~84 days

Recently: every ~167 days

Total

10

Last Release

802d ago

Major Versions

v0.1.0 → v1.0.02022-01-30

PHP version history (2 changes)v0.1.0PHP ^8.0

v1.2.2PHP ^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4942e3e9192a51df0a31f069fbf6ded0e0f656dd4aa02bd173f5ba9a4b2ba0bf?d=identicon)[hesamzakerirad](/maintainers/hesamzakerirad)

---

Top Contributors

[![hesamzakerirad](https://avatars.githubusercontent.com/u/47180715?v=4)](https://github.com/hesamzakerirad "hesamzakerirad (77 commits)")

---

Tags

httplaravelloggingphphttplogphplaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hesamrad-laravel-flashlight/health.svg)

```
[![Health](https://phpackages.com/badges/hesamrad-laravel-flashlight/health.svg)](https://phpackages.com/packages/hesamrad-laravel-flashlight)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[tomschlick/request-migrations

HTTP Request Migrations

1844.5k](/packages/tomschlick-request-migrations)[sockeon/sockeon

Framework-agnostic PHP WebSocket and HTTP server library with attribute-based routing and support for namespaces and rooms.

291.3k2](/packages/sockeon-sockeon)[laragear/api-manager

Manage multiple REST servers to make requests in few lines and fluently.

161.8k](/packages/laragear-api-manager)

PHPackages © 2026

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