PHPackages                             lawrence72/flightbag - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. lawrence72/flightbag

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

lawrence72/flightbag
====================

Toolkit for Flight PHP - Sanitize input,basic cookie and session wrapper

v2.2(2y ago)1100MITPHPPHP &gt;=7.4

Since Mar 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Lawrence72/flightbag)[ Packagist](https://packagist.org/packages/lawrence72/flightbag)[ RSS](/packages/lawrence72-flightbag/feed)WikiDiscussions main Synced 1mo ago

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

Flight Bag
==========

[](#flight-bag)

Flight bag is a lightweight tool kit for the Flight PHP Framework ()

### How to install

[](#how-to-install)

composer require lawrence72/flightbag

### Sanitizer

[](#sanitizer)

$sanitizer = new Sanitizer(); OR Flight::register('sanitizer', Sanitizer::class);

$text = "Some Text" $new\_text = $sanitizer-&gt;clean($text);

#### How to use with HTML tags

[](#how-to-use-with-html-tags)

Include the tags you wish to allow $text = "**Some Text**" $new\_text = $sanitizer-&gt;clean($text,\['b'\]);

Sanitizer accepts strings,arrays,objects or Flight Collections

#### Encoding the output

[](#encoding-the-output)

By default, the sanitizer will encode charaters into UTF-8.

This can be turned off by including a NULL value in the clean() method

$new\_text = $sanitizer-&gt;clean($text,\[\],NULL);

Or change the encoding to another encoding type by adding the type to the clean() method. $new\_text = $sanitizer-&gt;clean($text,\[\],'GB18030');

### Session

[](#session)

$session = new Session(); OR Flight::register('session', Session::class);

$session-&gt;set('user\_id', 1);

$has\_user\_id = $session-&gt;has('user\_id');

$get\_user\_id = $session-&gt;get('user\_id');

$session-&gt;remove('user\_id');

$session-&gt;destroy();

Session also accepts an optional encryption key. This will encrypt the session data.

$session = new Session('some\_very\_secure\_key');

##### Flash Messages

[](#flash-messages)

Flash messages is also supported

setFlash accepts a message and a class name to assign to the flash message. $session-&gt;setFlash('message','warning');

getFlash returns an array of recently added flash messages, flash messages are automatically removed after getFlash is called.

$session-&gt;getFlash();

### Cookie

[](#cookie)

$cookie = new Cookie(); OR Flight::register('cookie', Cookie::class);

$cookie-&gt;cookie()-&gt;set('token', 'somevalue', 3600);

set() accepts all PHP cookie options.

$cookie-&gt;cookie()-&gt;has('token');

$cookie-&gt;cookie()-&gt;get('token');

$cookie-&gt;cookie()-&gt;remove('token');

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

Total

6

Last Release

738d ago

Major Versions

v1.0.2 → v2.02024-03-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4070d1a302268e581e2e07989a9efc924f2d96d947c3256deb7697e9fa27b4d?d=identicon)[koalacreek](/maintainers/koalacreek)

---

Top Contributors

[![Lawrence72](https://avatars.githubusercontent.com/u/49914839?v=4)](https://github.com/Lawrence72 "Lawrence72 (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lawrence72-flightbag/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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