<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasFactory;
    protected $table = 'users';
    protected $primaryKey = 'id';



    protected $fillable = [
        'name',
        'username',
        'email',
        'password',
        'image',
        'id_roleuser',
        'created_at',
        'updated_at'
    ];
    public $timestamps = true;


    public function role()
    {
        return $this->belongsTo(Roleuser::class, 'id_roleuser', 'id_role');
    }


}