yudhatp / laravel-helpers
Collection of helper functions for laravel
0.0.7
2024-03-27 21:55 UTC
Requires
- php: ^7.3|^8.0
- laravel/framework: ^6.0|^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- phpunit/phpunit: ^9.3
- symfony/var-dumper: ^5.0
README
Collection of (16) helper functions for Laravel 6.x, 7.x, 8.x, 9.x, 10,x.
Installation
You can install the package via composer:
composer require yudhatp/laravel-helpers
Usage
use Yudhatp\Helpers\Helpers; //date helpers (7) Helpers::indonesianDate("2022-11-28"); //28 November 2022 Helpers::indonesianShortDate("2022-11-28"); //28 Nov 22 Helpers::indonesianDayName("2022-11-29"); //Selasa Helpers::indonesianMonthName("2022-11-29"); //November Helpers::getAgeIndonesian("1945-08-17"); //77 Tahun, 3 Bulan, 12 Hari Helpers::isWeekend("2022-11-29"); //false Helpers::addDays("2022-11-28",2); //2022-11-30 //number helpers (4) Helpers::terbilang("2000"); //Dua Ribu Helpers::indonesianFormatDecimal("2,000.50"); //2.000,50 Helpers::calcIDFormatDecimal("2,000,000.50"); //2000000.50 Helpers::isPrime(2); //true //string helpers(1) Helpers::isPalindrome("level"); //true //other helpers (4) Helpers::indonesianPoliceNumberformat("B123XYZ"); //B 123 XYZ Helpers::generatePassword(8); //EPp218kR Helpers::filenameWithTimestamp("test","jpg"); //1669704266_test.jpg Helpers::randomHexColor(); //#D15AF0 //blade {{ (new \Yudhatp\Helpers\Helpers)->indonesianMonthName("2022-11-28") }}
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- indonesianPoliceNumberformat - @matriphe
License
The MIT License (MIT). Please see License File for more information.