MIF_E31221259/app/Models/User.php

38 lines
589 B
PHP

<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
protected $fillable = [
'nim',
'username',
'name',
'email',
'no_hp',
'password',
'role',
];
protected $hidden = [
'password',
'remember_token',
];
public function isAdmin()
{
return $this->role === 'admin';
}
public function isUser()
{
return $this->role === 'user';
}
}