Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Models/User.php
Назад
<?php namespace App\Models; use \DateTimeInterface; use App\Notifications\VerifyUserNotification; use Carbon\Carbon; use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use App\Models\Message; use App\Models\Staff; use App\Traits\Observable; use App\Models\AccountManager; use Illuminate\Database\Eloquent\SoftDeletes; use ESolution\DBEncryption\Traits\EncryptedAttribute; class User extends Authenticatable { // use SoftDeletes; use Notifiable; use HasFactory,EncryptedAttribute,Observable,SoftDeletes; public $table = 'users'; protected $hidden = [ 'remember_token', 'password', ]; protected $dates = [ 'email_verified_at', 'verified_at', 'created_at', 'updated_at', 'deleted_at', ]; protected $fillable = [ 'name', 'email', 'password', 'email_verified_at', 'approved', 'user_type', 'device_token', 'verified', 'verified_at', 'verification_token', 'remember_token', 'status', 'created_at', 'updated_at', 'deleted_at', ]; protected $encryptable = [ 'name','email','password' ]; public function __construct(array $attributes = []) { parent::__construct($attributes); // self::created(function (User $user) { // $registrationRole = config('panel.registration_default_role'); // if (!$user->roles()->get()->contains($registrationRole)) { // $user->roles()->attach($registrationRole); // } // }); } public function getIsAdminAttribute() { return $this->roles()->where('id', 8)->exists(); } // public function getNameAttribute($value) { // return Crypt::decryptString($value); // } // public function getEmailAttribute($value) { // return Crypt::decryptString($value); // } // public function setNameAttribute($value) { // $this->attributes['name'] = Crypt::encryptString($value); // } // public function setEmailAttribute($value) { // $this->attributes['email'] = Crypt::encryptString($value); // } public function userUserAlerts() { return $this->belongsToMany(UserAlert::class); } 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 getVerifiedAtAttribute($value) { return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; } public function setVerifiedAtAttribute($value) { $this->attributes['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); } protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } public function customers(){ return $this->hasOne(CrmCustomer::class); } public function managers(){ return $this->hasOne(Manager::class); } public function staff(){ return $this->hasOne(Staff::class); } public function messages() { return $this->hasMany(Message::class,'reciever_id'); } public function salesManager() { return $this->hasOne(AccountManager::class); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка