<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Models\Doi_date;
use Illuminate\Http\Request;

class Passport extends Controller
{
    //
    protected function passport_check($passport_num, $id_num, Request $request)
    {
        if (!empty($passport_num) && !empty($id_num)) {
            $passport= Doi_date::where('passport_no', $passport_num)->where('identity_card_no', $id_num)->get();
            return response()->json([
                'status' => 'success, Found',
                'passport_num' => $passport_num,
                'id_num' => $id_num,
                'passport' => $passport
            ]);
        }else{
            return response()->json([
                'status' => 'Not Found',
                'data' => [
                    'passport_num' => $passport_num,
                    'id_num' => $id_num
                ]
            ], 400);
        }

    }
}
