PHP code example of erdemkeren / tr-nat-id-num-validator

1. Go to this page and download the library: Download erdemkeren/tr-nat-id-num-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/ */

    

erdemkeren / tr-nat-id-num-validator example snippets


...
'providers' => [
    ...
    Erdemkeren\Validators\TrNatIdNumValidator\TrNatIdNumValidationServiceProvider::class,
],
...


 
namespace App\Http\Controllers;
 
use Illuminate\Http\Request;
 
class ExampleController extends Controller
{
    public function index(Request $request)
    {
        $this->validate($request, [
            'tr_nat_id_num' => '

$validator = new TurkishNationalIdNumberValidator(new NviTcKimlikWebServiceRequest());

$result = $validator->validate(new NaturalizationRecord($trNatIdNum, $name, $surname, $birthYear));

'tr_nat_id_num' => "Vermek istediğiniz hata mesajı"