<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Perfiles extends Model
{
    protected $connection = 'mysql';
    protected $table = 'perfiles';
    public $timestamps = false;
    protected $primaryKey = 'idperfil';
    use HasFactory;

    public $fillable = [
        'idusuario',
        'idrol',
        'perfilestado',
    ];


    // /** @return \Illuminate\Database\Eloquent\Relations\HasMany **/ //
    public function roles()
    {
       return $this->hasMany(\App\Models\Rol::class, 'idrol');
    }

    // /** @return \Illuminate\Database\Eloquent\Relations\HasMany **/ //
    public function usuarios()
    {
        return $this->hasMany(\App\Models\Usuario::class, 'idusuario');
    }
}
