2017 © Pedro Peláez
 

library date-time-validator

Validate the date time in laravel controller

image

lynnlin/date-time-validator

Validate the date time in laravel controller

  • Tuesday, August 9, 2016
  • by lynnlin
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

date-time-validator

Build Status codecov.io Packagist license, (*1)

Description

Add a new validation rule during to validate whether the given date time is in a specific period which is 6 months by default., (*2)

Installation

Install the package via composer., (*3)

composer require lynnlin/date-time-validator

Add the service provider into config/app.php., (*4)

'providers' => [
    ...
    DateTimeValidator\ValidatorServiceProvider::class,
    ...
]

Usage

use Illuminate\Support\Facades\Validator;

// check 20160123 whether it is in 6 months ago from today
Validator::make(
    ['startAt' => '20160123'],
    ['startAt' => 'during']
);

// check 20150123 whether it is in 1 year ago from today since endAt is not given in the first argument
Validator::make(
    ['startAt' => '20150123'],
    ['startAt' => 'during:endAt,1Y', 'endAt' => 'string']
);

// check 20150123 whether it is in 1 day from 20150124
Validator::make(
    ['startAt' => '20150123', 'endAt' => '20150124'],
    ['startAt' => 'during:endAt,1d', 'endAt' => 'string']
);

// check 20150123 whether it is in 1 week from 20150124
Validator::make(
    ['startAt' => '20150123', 'endAt' => '20150124'],
    ['startAt' => 'during:endAt,1w', 'endAt' => 'string']
);

The Versions

09/08 2016

dev-master

9999999-dev

Validate the date time in laravel controller

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lynn Lin

laravel validator

09/08 2016

1.0.0

1.0.0.0

Validate the date time in laravel controller

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lynn Lin

laravel validator

09/08 2016

1.0.1

1.0.1.0

Validate the date time in laravel controller

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lynn Lin

laravel validator

09/08 2016

1.0.2

1.0.2.0

Validate the date time in laravel controller

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lynn Lin

laravel validator