sukohi/time-label
Larablocks Analysis
sukohi/time-label works with Laravel 5 (latest release 2.0.1, Oct 17, 2015), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Oct 17, 2015)
- 0 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Oct 17, 2015.
- No releases in the last 12 months.
- First released: Oct 17, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require sukohi/time-label |
|
| Latest Version: | 2.0.1 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Oct 17, 2015 |
| Links: | GitHub · Packagist |
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
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| 2.0.1 | ~5.0 | MIT | |
| 2.0.0 | ~5.0 | MIT |