HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/dev-telemedicina.teky.com.co/app/User.php
<?php

namespace Telemedicina;

use Telemedicina\Rol;
use Telemedicina\Module;
use Telemedicina\MedicalCenter;
use Laravel\Passport\HasApiTokens;
use Telemedicina\Traits\Encryptable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasApiTokens, Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be encrypt.
     *
     * @var array
     */
    // protected $encryptable = [
    //     'name',
    //     'last_name',
    //     // 'phone',
    //     // 'emergency_contact_name',
    //     // 'emergency_contact_phone',
    //     // 'dob',
    //     // 'address'
    // ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    public function findForPassport($document)
    {
        return $this->where('document', $document)->first();
    }

    public function rol(){
        return $this->belongsTo(Rol::class)->select(array('id','name'));
    }

    public function terms(){
        return $this->hasMany(UserTerm::class);
    }

    public function user_terms()
    {
        return $this->hasMany(UserTerm::class);
    }

    public function modules(){
        return $this->belongsTo(Module::class)->select(array('id','name'));
    }

    public function centro(){
        return $this->belongsTo(MedicalCenter::class, 'center_id', 'id');
    }

    public function identification_type(){
        return $this->belongsTo(IdentificationType::class, 'identification_type_id');
    }

    public function city(){
        return $this->belongsTo(City::class)->with('department');
    }

    public function insurance(){
        return $this->belongsTo(Insurance::class);
    }

    public function specialty(){
        return $this->belongsTo(Specialty::class);
    }

    /**
     * Sends the password reset notification.
     *
     * @param  string $token
     *
     * @return void
     */
    public function sendPasswordResetNotification($token)
    {
        $this->notify(new CustomPassword($token));
    }
}

class CustomPassword extends ResetPassword
{
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->from(config('mail.from.address'))
            ->subject(__('messages.password_reset.subject'))
            ->greeting(__('messages.password_reset.greeting'))
            ->line(__('messages.password_reset.line1'))
            ->action(__('messages.password_reset.password_reset'), url(config('app.url') . route('password.reset', $this->token, false)))
            ->line(__('messages.password_reset.line2'));
    }
}