2017 © Pedro Peláez
 

library agnomen

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

image

sukohi/agnomen

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

  • Thursday, August 20, 2015
  • by Sukohi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Agnomen

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation., (*1)

Installation

Add this package name in composer.json, (*2)

"require": {
  "sukohi/agnomen": "1.*"
}

Execute composer command., (*3)

composer update

Usage

At first, add AgnomenTrait to App/Http/Requests/Request.php like this., (*4)

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Sukohi\Agnomen\AgnomenTrait;

abstract class Request extends FormRequest
{
    use AgnomenTrait;

    private $attribute_names = [
        'email' => 'YOUR-TEXT-1',
        'password' => 'YOUR-TEXT-2',
        'accepted' => 'YOUR-TEXT-3'
    ];

}

And make your own Request using the following command., (*5)

php artisan make:request *****Request
  • see here for the details

then add your validation rules there like this., (*6)

public function rules()
{
    return [
        'email' => 'required',
        'password' => 'required', 
        'accepted' => 'accepted'
    ];
}

Now if your application respond error messages, :attribute will be replaced with $attribute_names values.
See here for the details, (*7)

e.g.), (*8)

The :attribute field is required. => The YOUR-TEXT-1 field is required., (*9)

License

This package is licensed under the MIT License., (*10)

Copyright 2015 Sukohi Kuhoh, (*11)

The Versions

20/08 2015

dev-master

9999999-dev

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

  Sources   Download

The Requires

 

by Avatar Sukohi

20/08 2015

1.0.x-dev

1.0.9999999.9999999-dev

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

  Sources   Download

The Requires

 

by Avatar Sukohi

20/08 2015

1.0.1

1.0.1.0

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

  Sources   Download

The Requires

 

by Avatar Sukohi

20/08 2015

1.0.0

1.0.0.0

A PHP package mainly developed for Laravel to set attributes for error messages of when failing validation.

  Sources   Download

The Requires

 

by Avatar Sukohi