unicodeveloper / laravel-yearly by unicodeveloper

Provides helper function to get the current year and a range of years
4,094
10
4
Package Data
Maintainer Username: unicodeveloper
Maintainer Contact: prosperotemuyiwa@gmail.com (unicodeveloper)
Package Create Date: 2015-09-14
Package Last Update: 2016-04-16
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-11 15:01:08
Package Statistics
Total Downloads: 4,094
Monthly Downloads: 1
Daily Downloads: 1
Total Stars: 10
Total Watchers: 4
Total Forks: 4
Total Open Issues: 0

laravel-yearly

Latest Stable Version License Build Status Quality Score Total Downloads

Laravel 5 Package to help keep your copyright year up-to-date. Simple but insanely useful.

Install

PHP 5.5+ or HHVM 3.3+, and Composer are required.

Via Composer

$ composer require busayo/laravel-yearly

Another alternative is to simply add the following line to the require block of your composer.json file.

"unicodeveloper/laravel-yearly": "1.1.*"

Then run composer install or composer update to download it and have the autoloader updated.

Add this to your providers array in config/app.php


// Laravel 5: config/app.php

'providers' => [
    ...
    'Unicodeveloper\Yearly\YearlyServiceProvider',
    ...
];

This package also comes with a facade


// Laravel 5: config/app.php

'aliases' => [
    ...
    'Yearly' => 'Unicodeveloper\Yearly\YearlyFacade',
    ...
]

Usage

Use it in your views, preferably in your footer section like this:


{{ current_year() }}  // returns 2015 ( This is the current year presently )

{{ year_range(2002) }} // returns 2002 - 2015

For those that love Facades immensely, I have provided the cake for you :smile: like so:


{{ Yearly::current_year() }}  // returns 2015 ( This is the current year presently )

{{ Yearly::year_range(2002) }} // returns 2002 - 2015

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

You can run the tests with:

vendor/bin/phpunit run

Alternatively, you can run the tests like so:

composer test

Inspiration

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.