shegunbabs / laravel-helpers
Awesome Laravel Helpers
v0.1.1
2021-12-06 12:35 UTC
Requires
- ext-intl: *
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- illuminate/support: ^7.0|^8.0
- spatie/emoji: ^3.0
Requires (Dev)
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.0
- pestphp/pest: ^1.21
- phpunit/phpunit: ^9.0
README
Installation
composer require shegunbabs/laravel-helpers
Helpers
carbon
shortcut for new Carbon
or Carbon::parse()
carbon('today'); //2021-11-29 00:00:00 carbon('yesterday'); //2021-11-28 00:00:00
emoji
print emojis using php
emoji('CHARACTER_GRINNING_FACE'); //😀
This function is based on the Spatie Emoji package. Refer to the documentation for more information
chain
Make an ordinary object chainable.
chain(new SomeClass) ->firstMethod() ->secondMethod() ->thirdMethod(carry); // Use "carry" constant to pass the return value of a method into the other. chain(new Str)->lower('John Doe')->camel(carry); // returns "johnDoe" // You can grab the result of the chain by trailing a "()" on the end of it.