PHPackages                             escapework/laravel-steroids - 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. [Framework](/categories/framework)
4. /
5. escapework/laravel-steroids

ActiveLibrary[Framework](/categories/framework)

escapework/laravel-steroids
===========================

Steroids for Laravel 5.

0.7.0(8y ago)53.3k↓100%2MITPHPPHP &gt;=5.6.0

Since Mar 20Pushed 8y ago7 watchersCompare

[ Source](https://github.com/EscapeWork/LaravelSteroids)[ Packagist](https://packagist.org/packages/escapework/laravel-steroids)[ RSS](/packages/escapework-laravel-steroids/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (21)Used By (0)

Laravel on Steroids
===================

[](#laravel-on-steroids)

[![Build Status](https://camo.githubusercontent.com/aebad6d068c748f048d303ba54c969ba94a1b6eafade1c84ea32c03fc0db361e/68747470733a2f2f7472617669732d63692e6f72672f457363617065576f726b2f4c61726176656c537465726f6964732e706e67)](http://travis-ci.org/EscapeWork/LaravelSteroids) [![Latest Stable Version](https://camo.githubusercontent.com/7605162c94f02c735aa02601088182fc08e884478ae7bd48da22e5166344d19e/68747470733a2f2f706f7365722e707567782e6f72672f657363617065776f726b2f6c61726176656c2d737465726f6964732f762f737461626c652e706e67)](https://packagist.org/packages/escapework/laravel-steroids) [![Total Downloads](https://camo.githubusercontent.com/4daa38aa8d109268eb7fb129811b0c59cf890b1b79a92e91f8755a9d08b3d409/68747470733a2f2f706f7365722e707567782e6f72672f657363617065776f726b2f6c61726176656c2d737465726f6964732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/escapework/laravel-steroids) [![MIT Licence](https://camo.githubusercontent.com/39ff59380d93c3968ba217c64fbcd3383bc1b685db8b6dd208aef72733f49d57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f457363617065576f726b2f6c6172616d65646961732e7376673f7374796c653d666c6174)](https://github.com/EscapeWork/LaravelSteroids)

Just some goodies for making your Laravel Project even better.

Version Compatibility
---------------------

[](#version-compatibility)

LaravelLaravel on Steroids5.5.x - 5.6.x0.7.x@dev5.4.x0.6.x5.3.x0.5.x5.2.x0.4.x5.1.x0.3.xInstallation
------------

[](#installation)

```
$ composer require escapework/laravel-steroids:"0.7.*"
```

Usage
-----

[](#usage)

We offer a lot of base classes and helpers. Take a look.

First of all, your models now need to extend your base model.

```
use EscapeWork\LaravelSteroids\Model;

class Product extends Model
{
}
```

### Presenters

[](#presenters)

Just add a `Presentable` in your model:

```
use EscapeWork\LaravelSteroids\Presentable;

class Product extends Model
{
    use Presentable;

    protected $presenter = 'App\Presenters\ProductPresenter';
}
```

And create your presenter:

```
use EscapeWork\LaravelSteroids\Presenter;

class ProductPresenter extends Presenter
{
    public function title()
    {
        // $this->model gives you access to your model inside the presenter
        return ucwords($this->model->title);
    }
}
```

Then, you can just call the presenter methods like this:

```
$product = Product::find(1);
echo $product->present->title;
```

### Sluggable

[](#sluggable)

Want to make slugs with your model? Just add the `Sluggable` to your model.

```
use EscapeWork\LaravelSteroids\Sluggable;

class Product extends Model
{
    use Sluggable;
}
```

By default, when your model is created/updated, `Sluggable` will take your `$title` attribute, create a unique slug and put the value in the `$slug` attribute. If you want to change the field that is used to create the slug, just put a `$sluggableAttr` property on your model. And if you want to change the slug field, add the `$sluggableField` property.

```
class User extends Model
{
    use Sluggable;
    protected $sluggableAttr  = 'name';
    protected $sluggableField = 'username';
}
```

If you don't want the slug to be updated when your model is updated, set the `$makeSlugOnUpdate` property to `false`;

### Cacheable

[](#cacheable)

Cacheable is a model trait that clean up some cache keys when your model is changed/deleted. To use it, just add the `Cacheable` trait on your model:

```
use EscapeWork\LaravelSteroids\Cacheable;

class Product extends Model
{
    use Cacheable;

    protected $cacheable = [
        // here you need to put your cache keys that need to be cleared
        'products.actives',
        'products.all',

        // you can also use some attribute to be replaced
        // in this case, the {category_id} will be replaced with $product->category_id,
        'products.category.{category_id}'
    ];
}
```

### Sortable

[](#sortable)

Do you want to sort your models automatically? Easy.

```
use EscapeWork\LaravelSteroids\Sortable;

class Banner extends Model
{
    use Sortable;
}
```

Then:

```
Banner::create(['title' => 'First Banner'])->order;  // 1
Banner::create(['title' => 'Second Banner'])->order; // 2
```

If you `order` field is not called `order`, you just need to specify:

```
protected $sortable = [
    'field' => 'order',
];
```

### Ordenable

[](#ordenable)

Want to easily change the orderBy in your query? Easy.

```
use EscapeWork\LaravelSteroids\Ordenable;

class Product extends Model
{
    use Ordenable;

    protected $ordenables = [
        'price',
        'hits'
    ];

    protected $ordenableDefault = [
        'field'     => 'created_at',
        'direction' => 'desc',
    ];
}
```

Then, when querying:

```
$products = Product::where(...)->order('price', 'desc')->get();
```

If you try to order for a field that is not in the `$ordenables` array, your results will be sorted with the `$ordenableDefault` values.

License
-------

[](#license)

See the [License](https://github.com/EscapeWork/LaravelSteroids/blob/master/LICENSE) file.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.5% 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 ~48 days

Total

20

Last Release

3140d ago

PHP version history (3 changes)0.1.0PHP &gt;=5.4.0

0.3.0PHP &gt;=5.5.0

0.6.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/57e405b52d482c9de35b17f299d2745e8e68d9d9951aec64854f2d7fa53110bf?d=identicon)[luisdalmolin](/maintainers/luisdalmolin)

---

Top Contributors

[![luisdalmolin](https://avatars.githubusercontent.com/u/403446?v=4)](https://github.com/luisdalmolin "luisdalmolin (80 commits)")[![ehkasper](https://avatars.githubusercontent.com/u/988603?v=4)](https://github.com/ehkasper "ehkasper (17 commits)")

---

Tags

laravellaravel-5-packagelaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/escapework-laravel-steroids/health.svg)

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

###  Alternatives

[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[rahulalam31/laravel-abuse-ip

Block ip address of all spammer's around the world.

27431.5k](/packages/rahulalam31-laravel-abuse-ip)[laravel-frontend-presets/black-dashboard

Laravel 11.x Front-end preset for black dashboard

8726.2k](/packages/laravel-frontend-presets-black-dashboard)

PHPackages © 2026

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