Files
PeePal/Backend/peepal_backend/app/Models/User.php
Sándor Máté Magony c66a7dd66e Félkész Login
2025-04-01 07:50:41 +02:00

63 lines
1.3 KiB
PHP

<?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 HasApiTokens, HasFactory, Notifiable;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'users_table';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'nev',
'email',
'felh_nev',
'jelszo',
'is_admin',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'jelszo',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'is_admin' => 'boolean',
'email_verified_at' => 'datetime',
];
/**
* Automatically hash the password when it's set
*
* @param string $value
* @return void
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = \Illuminate\Support\Facades\Hash::make($value);
}
}