Download the PHP package sukohi/time-label without Composer
On this page you can find all versions of the php package sukohi/time-label. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sukohi/time-label
More information about sukohi/time-label
Files in sukohi/time-label
Download sukohi/time-label
More information about sukohi/time-label
Files in sukohi/time-label
Vendor sukohi
Package time-label
Short Description Laravel package to manage time labels like `This Month` and so on.
License MIT
Package time-label
Short Description Laravel package to manage time labels like `This Month` and so on.
License MIT
Please rate this library. Is it a good library?
Informations about the package time-label
TimeLabel
Laravel package to manage time labels like This Month
and so on.
Installation
Add this package name in composer.json
"require": {
"sukohi/time-label": "2.*"
}
Execute composer command.
composer update
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\TimeLabel\TimeLabelServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'TimeLabel' => Sukohi\TimeLabel\Facades\TimeLabel::class
]
Usage
$time_label = TimeLabel::setLabel([
'today' => 'Today',
'yesterday' => 'Yesterday',
'this_month' => 'This Month',
'last_month' => 'Last Month',
'other' => 'M, Y' // You need to set date format only here.
]);
$date_times = [
Carbon::now(),
Carbon::now(),
Carbon::now()->subDay(),
Carbon::now()->subDay(),
Carbon::now()->subDays(2),
Carbon::now()->subDays(4),
Carbon::now()->subDays(4),
Carbon::now()->subDays(5),
Carbon::now()->subDays(10),
Carbon::now()->subDays(20),
Carbon::now()->subDays(50),
Carbon::now()->subDays(150),
];
foreach($date_times as $dt) {
if($time_label->isFirst($dt)) {
echo $time_label->get($dt) .'<br>';
}
echo $dt .'<hr>';
}
License
This package is licensed under the MIT License.
Copyright 2015 Sukohi Kuhoh
All versions of time-label with dependencies
PHP Build Version
Package Version
Requires
laravel/framework Version
~5.0
The package sukohi/time-label contains the following files
Loading the files please wait ....