PHPackages                             depotwarehouse/toolbox - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. depotwarehouse/toolbox

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

depotwarehouse/toolbox
======================

A set of tools in PHP

4.0.6(9y ago)112.5k2[1 issues](https://github.com/tpavlek/Toolbox/issues)PHPPHP &gt;=5.6.0

Since Jul 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tpavlek/Toolbox)[ Packagist](https://packagist.org/packages/depotwarehouse/toolbox)[ RSS](/packages/depotwarehouse-toolbox/feed)WikiDiscussions master Synced 5d ago

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

Depotwarehouse.net Toolbox
==========================

[](#depotwarehousenet-toolbox)

[![Build Status](https://camo.githubusercontent.com/c6846115ea5feae32a02bcc15ba8bfc37f01d818dae8fbd1df9b5b4aa3a5eaea/68747470733a2f2f7472617669732d63692e6f72672f747061766c656b2f546f6f6c626f782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tpavlek/Toolbox)[![Coverage Status](https://camo.githubusercontent.com/e2853467009fa18e1b593921f815de65bbb53d365152d58b74a7626836fa207d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f747061766c656b2f546f6f6c626f782f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/tpavlek/Toolbox?branch=master)

This is a standard library of tools that abstracts common work needed to be done across all projects.

Database Management
-------------------

[](#database-management)

There are a couple of classes that make working with databases easier in projects. This is designed for use with Laravel, as they expose Eloquent models, however Laravel is not strictly necessary. The repository pattern allows for greater testability and easier to understand controllers. In your projects, simply create repositories that extend from `ActiveRepositoryAbstract`. For typehints you can use the contract `ActiveRepository`.

The active repository requires a `Validator` class to validate data processed within - this class is passed in via the constructor. You should either create your own validator implementing the `Validator` contract, or you can typehint the NullValidator to perform no validation on the model whatsoever.

```
class MyActiveRepository extends ActiveRepositoryAbstract
{
    public function __construct(\Illuminate\Database\Eloquent\Model $model, \Depotwarehouse\Toolbox\Validation\NullValidator $validator)
    {
        $this->model = $model;
        $this->validator = $validator;
    }
}
```

Validators are simple to implement. They were designed with Laravel validators in mind. They exceptions they throw, `ValidationException`s, can be passed a failing Laravel Validator to construct an instance.

To implement a validator, simply make a class that implements the `Validator` interface. The two methods should do nothing if validation passes and throw a `ValidationException` if an error occurs.

Strings
-------

[](#strings)

Commonly projects have string related needs that aren't easily filled by the PHP standard library.

`Strings\generateRandomString($length = 40)`This generates a random (pseudorandom, do *not* use this for cryptographic or security purposes) string of the given length. The convenient usage for this is generate noninteger keys for a database table.

`Strings\starts_with($haystack, $needle)`

`Strings\ends_with($haystack, $needle)`

Laravel Integration
-------------------

[](#laravel-integration)

### Errors Partial

[](#errors-partial)

This project ships with an Error Partial that displays errors, warnings and success messages at the top of the application page, based on a consistent format. To Install the Error Partial Handler in a Laravel application, add

```
Depotwarehouse\Toolbox\FrameworkIntegration\Laravel\ErrorPartialServiceProvider::class
```

to your `config/app.php` in the providers array. Next, you'll need to publish the view file with:

```
php artisan vendor:publish

```

Now in your layout page, where you want the errors to appear (likely at the top), simply add

```
@include('vendor.toolbox.errors.errorPartial')
```

Now errors, warnings and success messages will consistently render!

Testing
-------

[](#testing)

```
phpunit

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~26 days

Total

31

Last Release

3521d ago

Major Versions

v0.0.2-alpha → 1.0.02014-10-08

1.1.0 → 2.0.02015-02-24

2.2.0 → 3.0.02015-11-10

3.0.6 → 4.0.02016-06-02

PHP version history (4 changes)v0.0.1-alphaPHP &gt;=5.4.0

2.0.0PHP &gt;=5.5.0

4.0.0PHP &gt;=7.0.0

4.0.6PHP &gt;=5.6.0

### Community

Maintainers

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

---

Top Contributors

[![tpavlek](https://avatars.githubusercontent.com/u/782576?v=4)](https://github.com/tpavlek "tpavlek (100 commits)")[![msivia](https://avatars.githubusercontent.com/u/14058286?v=4)](https://github.com/msivia "msivia (2 commits)")[![jsonlorenz](https://avatars.githubusercontent.com/u/4493304?v=4)](https://github.com/jsonlorenz "jsonlorenz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/depotwarehouse-toolbox/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[wearepixel/laravel-cart

A cart implementation for Laravel

1310.5k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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