Файловый менеджер - Редактировать - /home/clickysoft/public_html/standup.clickysoft.net/app/Models/User.php
Назад
<?php namespace App\Models; use App\Notifications\VerifyUserNotification; use App\Traits\Auditable; use Carbon\Carbon; use DateTimeInterface; use Hash; use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Str; class User extends Authenticatable { use Notifiable, Auditable, HasFactory; public $table = 'users'; protected $hidden = [ 'remember_token', 'password', ]; protected $dates = [ 'email_verified_at', 'created_at', 'updated_at', ]; protected $fillable = [ 'name', 'email', 'email_verified_at', 'password', 'remember_token', 'created_at', 'updated_at', 'team_id', 'worksnap_id', 'worksnap_username', ]; protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } public function getIsAdminAttribute() { return $this->roles()->where('id', 1)->exists(); } public function __construct(array $attributes = []) { parent::__construct($attributes); self::created(function (self $user) { $registrationRole = config('panel.registration_default_role'); if (! $user->roles()->get()->contains($registrationRole)) { $user->roles()->attach($registrationRole); } }); } public function getEmailVerifiedAtAttribute($value) { return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; } public function setEmailVerifiedAtAttribute($value) { $this->attributes['email_verified_at'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null; } public function setPasswordAttribute($input) { if ($input) { $this->attributes['password'] = app('hash')->needsRehash($input) ? Hash::make($input) : $input; } } public function sendPasswordResetNotification($token) { $this->notify(new ResetPassword($token)); } public function roles() { return $this->belongsToMany(Role::class); } public function team() { return $this->belongsTo(Team::class, 'team_id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка