tohtamysh / laravel-helpers
Helper function for Laravel 5
Installs: 458
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/tohtamysh/laravel-helpers
Requires
- php: >=7.0
- illuminate/support: 5.*
- nesbot/carbon: ^1.26.3 || ^2.0
README
Installation
run composer
composer require tohtamysh/laravel-helpers
For Laravel < 5.5
add service provider
Register the Service Provider by adding it to your project's providers array in app.php
'providers' => array( Tohtamysh\Helper\HelperServiceProvider::class, );
add alias
'Helper' => Tohtamysh\Helper\HelperFacade::class,
Use
Get correct russian ending
example return 'домов'
$end = Helper::ending(55, 'дом', 'дома', 'домов')
Get russian date
example return 'Января'
$russian_date = Helper::russianDate('2017-01-02', 'month', true)
Reduces image size without loss of quality.
optimizeImage($filePath)
Format time
example return '01:20'
$end = Helper::timeFormat(80)