<?php

namespace App\Http\Controllers;

use App\Models\Municipios;
use Illuminate\Http\Request;

class MunicipiosController extends Controller
{

    public function getMunicipios(Request $request) {
        return json_encode(Municipios::on('costos_principal')->where('dep_fk_id', $request->input('depto'))
                                    ->orderBy('mun_pk_id', 'asc')->get());
    }
}
