crud user
This commit is contained in:
34
app/Models/User.php
Normal file
34
app/Models/User.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $username
|
||||
* @property string $email
|
||||
* @property string $password_hash
|
||||
* @property string $user_photo
|
||||
* @property string $access_token
|
||||
* @property string $access_token_expires_at
|
||||
* @method static find($id)
|
||||
*/
|
||||
class User extends Model {
|
||||
|
||||
const DEFAULT_USER_ROLE = 1;
|
||||
const ADMIN_USER_ROLE = 9;
|
||||
|
||||
protected $table = 'user';
|
||||
protected $fillable = ['username', 'email', 'password_hash', 'user_photo', 'role', 'access_token', 'access_token_expires_at'];
|
||||
protected array $dates = ['deleted at'];
|
||||
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
'username' => 'Логин',
|
||||
'email' => 'Email',
|
||||
'user_photo' => 'Фото профиля',
|
||||
'created_at' => 'Создан',
|
||||
'updated_at' => 'Обновлен',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user