PHPackages                             bluefyn-international/sidekick - 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. bluefyn-international/sidekick

Abandoned → [always-open/sidekick](/?search=always-open%2Fsidekick)Library[Utility &amp; Helpers](/categories/utility)

bluefyn-international/sidekick
==============================

A collection of helper classes to make fighting the good fight easier

v6.0.4(3mo ago)16.1k3MITPHPPHP ^8.3.0|^8.4.0CI failing

Since Jun 17Pushed 3mo ago6 watchersCompare

[ Source](https://github.com/always-open/sidekick)[ Packagist](https://packagist.org/packages/bluefyn-international/sidekick)[ Docs](https://github.com/always-open/sidekick)[ GitHub Sponsors](https://github.com/always-open)[ RSS](/packages/bluefyn-international-sidekick/feed)WikiDiscussions 6.x Synced 6d ago

READMEChangelog (10)Dependencies (11)Versions (45)Used By (0)

A collection of helper classes to make fighting the good fight easier
=====================================================================

[](#a-collection-of-helper-classes-to-make-fighting-the-good-fight-easier)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5512a2d7c8ad4c3de927da2bab9cff513aee2255cd60718d5dc47aca12bc470a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c776179732d6f70656e2f736964656b69636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/always-open/sidekick)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c1af85f2893d154c38cb0ee07f86c4f0eb61e84818c3f6499750aa01735fd38c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f616c776179732d6f70656e2f736964656b69636b2f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/always-open/sidekick/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/b52ef604df8ee8b3d4d43eef8052285163e26e52acb74a7e94dc4cc51993fc28/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f616c776179732d6f70656e2f736964656b69636b2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/always-open/sidekick/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/2b999e081a438b15c72571656bf1057abff5f902b2e34d4758986e0d724cdc21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c776179732d6f70656e2f736964656b69636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/always-open/sidekick)[![Maintainability](https://camo.githubusercontent.com/1c37c7df3ae441410a8ce15b55b6f5a42427e86fd264b6af391c883fcc076dcb/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34396565343262343837616164353133383636662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/always-open/sidekick/maintainability)

Collection of helper classes to make fighting the good fight even easier.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require always-open/sidekick
```

Version Support
---------------

[](#version-support)

Sidekick versionPHP Version1.xPHP 7.4 and 8.x4.xPHP 8.x+5.xPHP 8.2+6.xPHP 8.3+Usage
-----

[](#usage)

### Helpers

[](#helpers)

#### String Helper

[](#string-helper)

```
$ids = AlwaysOpen\Helpers\Strings::stringIdsToCollection('1,3,45, asdf,66,1,45,3');
var_dump($ids);
```

#### Routes Helper

[](#routes-helper)

This helper stops redirect loops where a `url()->previous()` might be used but the user could have directly input the url so `previous` and `current` are the same. This helper stops that from happening while allowing you to specify where to go if that scenario happens.

If the user can edit user profiles and reach it from multiple screens the redirect response after saving might look like this:

```
return response()->redirectTo(
    AlwaysOpen\Helpers\Routes::toRouteIfBackIsLoop('user.report')
);
```

Here the user will either go to their previous URL or get sent to the user report.

### Traits

[](#traits)

#### ByName

[](#byname)

Add the trait to your model:

```
