Laravel 5 Package that keeps your copyright up to date. Guys, it's a serious issue, no jokes!!!
MIT License
Laravel 5 Package to help keep your copyright year up-to-date. Simple but insanely useful.
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',
...
]
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 😄 like so:
{{ Yearly::current_year() }} // returns 2015 ( This is the current year presently )
{{ Yearly::year_range(2002) }} // returns 2002 - 2015
Please see CHANGELOG for more information what has changed recently.
You can run the tests with:
vendor/bin/phpunit run
Alternatively, you can run the tests like so:
composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.