kanekescom / laravel-helperia
Helper for rapid Laravel development improvements
Fund package maintenance!
achmadhadikurnia
Buymeacoffee
Patreon
Saweria
Installs: 3 388
Dependents: 5
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 2
Open Issues: 1
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
Helper for rapid Laravel development improvements. This library is a function and class to help improve Laravel development.
Support us
Want to provide tangible support? Use the following platform to contribute to open-source software developers. Every contribution you make is a significant boost to continue building and enhancing technology that benefits everyone.
- Buy Me a Coffee https://s.id/hadibmac
- Patreon https://s.id/hadipatreon
- Saweria https://s.id/hadisaweria
We highly appreciate you sending us a few cups of coffee to accompany us while writing code. Super thanks.
Installation
You can install the package via composer:
composer require kanekescom/laravel-helperia
Usage
HasMethodCaller
Make your class return the functionality of another class. This is useful when you want your logic to be returned as another class, Laravel Collection for example.
Here's an example of how to use it to make your classes feel like Laravel Collections.
use Kanekescom\Helperia\Traits\HasMethodCaller; class MyClass { use HasMethodCaller; protected $class; public function __construct($array = []) { $this->class = collect($array); } }
or use ClassExtender
instead
ClassExtender
use Kanekescom\Helperia\Support\ClassExtender; class MyClass extends ClassExtender { public function __construct($array = []) { $this->class = collect($array); } }
Get Methods of Class
Get the methods that a class has based on its visibility type. Returned as Laravel Collection.
Get public methods
method_public(MyClass::class);
Get protected methods
method_protected(MyClass::class);
Get private methods
method_private(MyClass::class);
Convert Date
Convert date format
convert_date_format('01-01-2024', 'd-m-Y', 'Y-m-d', $default = null);
Parse date to format.
parse_date_format('01-01-2024', 'Y-m-d', $default = null);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.