PHPackages                             multihanded/overload - 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. multihanded/overload

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

multihanded/overload
====================

An Artisan command that simplifies the process of creating trait-based method overloads by the number of arguments.

02PHP

Since Jun 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/YakutD/MultihandED-Overload)[ Packagist](https://packagist.org/packages/multihanded/overload)[ RSS](/packages/multihanded-overload/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

MultihandED-Overload
====================

[](#multihanded-overload)

An Artisan command that simplifies the process of creating trait-based method overloads by the number of arguments.

The package allows you to quickly create templates for traits, on the basis of which you can implement the mechanism of overloading methods by the number of arguments.

The *overload:create* command takes 2 arguments: *method* (the name of the method used in the created trait) and *namespace* (the namespace of the trait, where the last segment is the name of the trait. All traits are created in the *app* directory, by default in the *Traits\\Overloads* subdirectories, however you can set your own subdirectories by setting the *TRAITS\_DIRECTORY* variable in .env to your liking.

The resulting namespace for all newly created traits already includes the *App\\TRAITS\_DIRECTORY* segments, so there is no need to specify them in the namespace parameter when generating.

For each namespace, a single trait is created, with the postfix Main. It connects all other traits of the same namespace. When generating each new trait, this file is automatically updated.

**EXAMPLE:**

*php artisan overload:create test\_func Test\\TestOverload*

Get generated files *TestOverload*

```
