1. Go to this page and download the library: Download ognjen/laravel-validatable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ognjen / laravel-validatable example snippets
namespace App;
use Illuminate\Database\Eloquent\Model;
use Ognjen\Laravel\Validatable;
class User extends Model {
use Validatable;
const VALIDATION_MESSAGES = ['age.numeric'=> 'Custom numeric message'];
protected $fillable = ['name', 'email', 'age'];
protected function getValidationMessages()
{
return self::VALIDATION_MESSAGES;
}
protected function getValidationRules()
{
return [
'name' => '