PHP code example of engency / laravel-model-validation
1. Go to this page and download the library: Download engency/laravel-model-validation 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/ */
engency / laravel-model-validation example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Engency\ModelValidation\Validatable;
Class User extends Model
{
use Validatable;
}
namespace App\ModelValidators;
use Engency\ModelValidation\ModelValidator;
Class UserModelValidator extends ModelValidator
{
/**
* @return array
*/
public function rules() : array {
return [
'name' => '