2017 © Pedro Peláez
 

library laravel-datable

A tiny Laravel package for easily switching localized dates

image

flobbos/laravel-datable

A tiny Laravel package for easily switching localized dates

  • Wednesday, April 12, 2017
  • by Flobbos
  • Repository
  • 0 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel-Datable

Laravel Databale, (*1)

For easy date localization, (*2)

If you have trouble working with localized date formats used in combination with translations then this package might be for you. It simply provides a trait that you can add to your models which use https://github.com/jenssegers/date to provide localized date outputs., (*3)

Docs

Installation

Install the package

composer require flobbos/laravel-datable

That's it. Nothing else to do at this point., (*4)

Usage

Add it to the model


namespace App; use Illuminate\Database\Eloquent\Model; use Flobbos\Datable; class Event extends Model { use Datable\Datable; protected $dates = [ 'starts_on', 'ends_on' ]; }

This is all you need to do to make it work. You won't notice a difference anywhere except when you're pulling formats like this:, (*5)

    $your_model->starts_on->format('d. F Y');

The output will then have the localized month name instead of the default English., (*6)

Laravel compatibility

Laravel Crudable
5.6 >=0.4
5.5 >=0.4
5.4 >=0.4
5.3 >=0.4
5.2 >=0.1
5.1 >=0.1

The Versions

12/04 2017

dev-master

9999999-dev

A tiny Laravel package for easily switching localized dates

  Sources   Download

MIT

The Requires

 

laravel date carbon

12/04 2017

0.3

0.3.0.0

A tiny Laravel package for easily switching localized dates

  Sources   Download

MIT

The Requires

 

laravel date carbon

12/04 2017

0.2

0.2.0.0

A tiny Laravel package for easily switching localized dates

  Sources   Download

MIT

The Requires

 

laravel date carbon

12/04 2017

0.1

0.1.0.0

A tiny Laravel package for easily switching localized dates

  Sources   Download

MIT

The Requires

 

laravel date carbon