<?php

namespace App;

use App\Traits\ApiResponser;
use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;

class TiposDocumento extends Model 
{
  use ApiResponser;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
protected $table='tiposDocumento';
    //protected $table = [
     //   'tipo','nombre', 'nom_corto',
    //];
    public function list_tipoDocuments(){
        try {
           $documents= DB::select('call SP_LISTAR_TIPO_DOCUMENTOS()');
           return $this->SuccessResponse($documents);
        } catch (\Throwable $th) {
            return $this->ErrorResponse($th,Response::HTTP_INTERNAL_SERVER_ERROR);
        }
       
    }

}
