Download the PHP package joshbrw/laravel-contextual-dates without Composer
On this page you can find all versions of the php package joshbrw/laravel-contextual-dates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download joshbrw/laravel-contextual-dates
More information about joshbrw/laravel-contextual-dates
Files in joshbrw/laravel-contextual-dates
Download joshbrw/laravel-contextual-dates
More information about joshbrw/laravel-contextual-dates
Files in joshbrw/laravel-contextual-dates
Vendor joshbrw
Package laravel-contextual-dates
Short Description Contextual date functionality in Laravel.
License MIT
Package laravel-contextual-dates
Short Description Contextual date functionality in Laravel.
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-contextual-dates
Laravel Contextual Dates
Installation
- Install the package via Composer:
composer require joshbrw/laravel-contextual-dates
- Add the Service Provider to
config/app.php
:Joshbrw\LaravelContextualDates\ContextualDatesServiceProvider::class
- Configure the
DateTimeFactory
with the desired Timezone and Formats. These formats can be named whatever you like, i.e.long
orshort
. - Use the
FormatsDates
trait or the helpers defined inhelpers.php
to localize/output the dates.
Defaults
Two date formats are provided by default, long
and short
. These can be over-ridden at any time.
Examples
Using Container
The DateTimeFactory
is bound as a singleton in the container, so it can be picked up and modified at any time (similar to the inbuilt View/Validation factories that Laravel provides).
Using Helpers
This package ships with two helper methods; localize_date()
and format_date()
.
Using Blade Directive
You can format dates in the Views using the Blade Directive. All this does is proxy to the format_date()
helper method.
All versions of laravel-contextual-dates with dependencies
PHP Build Version
Package Version
The package joshbrw/laravel-contextual-dates contains the following files
Loading the files please wait ....