<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class ZipcodeController extends Controller
{
    public function validatecp($zipcode){

        $exists = DB::table('tms_am_zipcodes')->where('zipcode', $zipcode)->get();

        if($exists->isEmpty()){
            return response("No existe este zipcode", 404);
        }else{
            return $exists;
        } 
    }
}
