PHP code example of tavo1987 / laravel-ec-validator
1. Go to this page and download the library: Download tavo1987/laravel-ec-validator 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/ */
// Validate Cédula (ID card)
$this->validate($request, [
'cedula' => 'ecuador:ci',
]);
// Validate RUC for natural person
$this->validate($request, [
'ruc' => 'ecuador:ruc',
]);
// Validate RUC for public company
$this->validate($request, [
'ruc' => 'ecuador:ruc_spub',
]);
// Validate RUC for private company
$this->validate($request, [
'ruc' => 'ecuador:ruc_spriv',
]);
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreClientRequest extends FormRequest
{
public function rules(): array
{
return [
'cedula' => ['
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.