PHPackages                             aybarsm/laravel-extended-support - 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. aybarsm/laravel-extended-support

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

aybarsm/laravel-extended-support
================================

Additional mixins for Laravel Macroable Facades and helpers

v1.0.7(2y ago)0131MITPHPPHP ^8.1

Since Aug 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/aybarsm/laravel-extended-support)[ Packagist](https://packagist.org/packages/aybarsm/laravel-extended-support)[ Docs](https://github.com/aybarsm/laravel-extended-support)[ RSS](/packages/aybarsm-laravel-extended-support/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (13)Used By (1)

What It Does
------------

[](#what-it-does)

It contains custom mixin classes for built-in macroable facades and also can be configured to load external mixins dynamically. It also includes some custom functions and helper traits.

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

[](#installation)

You can install the package via composer:

```
composer require aybarsm/laravel-extended-support
```

You can publish the config file by:

```
php artisan vendor:publish --provider="Aybarsm\Laravel\Support\ExtendedSupportServiceProvider" --tag=config
```

Configure Mixins
----------------

[](#configure-mixins)

You can remove or add new mixins to the load list and modify concretes by extending classes.

```
return [
    'runtime' => [
        'replace_existing' => true,
        'class_autoload' => true,
        'required_trait' => 'Illuminate\Support\Traits\Macroable',
        'bind_pattern' => '/@mixin\s*([^\s*]+)/',
        'load' => [
            Aybarsm\Laravel\Support\Mixins\StringableMixin::class,
            Aybarsm\Laravel\Support\Mixins\StrMixin::class,
            Aybarsm\Laravel\Support\Mixins\ArrMixin::class,
            Aybarsm\Laravel\Support\Mixins\FileMixin::class,
            Aybarsm\Laravel\Support\Mixins\RuleMixin::class,
            Aybarsm\Laravel\Support\Mixins\ApplicationMixin::class,
            Aybarsm\Laravel\Support\Mixins\CommandMixin::class,
            Aybarsm\Laravel\Support\Mixins\ProcessMixin::class,
            Aybarsm\Laravel\Support\Mixins\CollectionMixin::class,
        ],
    ],
    'concretes' => [
        'ExtendedSupport' => Aybarsm\Laravel\Support\ExtendedSupport::class,
        'Supplements' => [
            'Str' => [
                'SemVer' => Aybarsm\Laravel\Support\Supplements\Str\SemVer::class,
            ],
            'Foundation' => [
                'Annotation' => Aybarsm\Laravel\Support\Supplements\Foundation\Annotation::class,
            ],
        ],
    ],
];
```

Custom Mixins
-------------

[](#custom-mixins)

You can create any new mixin by artisan command. The command will ask the class name and also provide the full list of classes that uses macroable trait to select easily or enter manually.

```
php artisan make:mixin ArrMixin
```

[![Make Mixin Command - Bind List](https://camo.githubusercontent.com/5e03e07602936176c9afe7884e37d2bdd1d3a95c644840b1e23ef168ea49d1fa/68747470733a2f2f692e706f7374696d672e63632f673268316b6651582f6d6978696e2d42696e642d4c6973742e706e67)](https://postimg.cc/Hrp66Ppd)[![Make Mixin Command - Bind Manual](https://camo.githubusercontent.com/d64b8f60178e8a1bdd5aa2672c44a6cd4e1686c6f20ee0a0aad3c2d892e25f07/68747470733a2f2f692e706f7374696d672e63632f367043314e4334432f6d6978696e2d42696e642d4d616e75616c2e706e67)](https://postimg.cc/cv4cRgmJ)

You can publish the stubs by:

```
php artisan vendor:publish --provider="Aybarsm\Laravel\Support\ExtendedSupportServiceProvider" --tag=stubs
```

Or you can manually create a class for mixin and identify the macroable class by @mixin annotation and add it to configuration to be loaded:

```
