PATH:
home
/
lab2454c
/
tripvare.com
/
app
/
Models
<?php namespace App\Models; use GoldSpecDigital\LaravelEloquentUUID\Database\Eloquent\Uuid; use Illuminate\Support\Facades\Auth; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Yadahan\AuthenticationLog\AuthenticationLogable; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Carbon; use Laravel\Cashier\Billable; class User extends Authenticatable { use HasFactory,Billable,Uuid,Notifiable,AuthenticationLogable; /** * The "type" of the auto-incrementing ID. * * @var string */ protected $keyType = 'string'; /** * Indicates if the IDs are auto-incrementing. * * @var bool */ public $incrementing = false; /** * The attributes that are mass assignable. * * @var array */ protected $guarded = []; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'first_name', 'last_name', 'profile_picture', 'email', 'password', // 'country_id', 'otp', 'account_status', 'created_at' ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; /** * The model's default values for attributes. * * @var array */ protected $attributes = [ 'account_status' => true, ]; /** * Create Password Hash * @param string $value * @return void * */ public function setPasswordAttribute($value) { $this->attributes['password'] = Hash::make($value); } /** * Get the country / nationality associated with the user. */ // public function country() // { // return $this->belongsTo(Country::class); // } /** * MembershipInformation relationship. */ public function membership_information() { return $this->hasOne(MembershipInformation::class); } /** * Travel Information relationship. */ public function travel_information() { return $this->hasOne(TravelInformation::class); } /** * Get the user created_at. * @param string $value * @return string */ public function getCreatedAtAttribute($date) { if(Auth::guard('admin')->check() && !Auth::guard('web')->check()){ return Carbon::createFromFormat('Y-m-d H:i:s', $date)->format('d/m/Y'); } } /** * Get the immunization associated with the user. */ public function immunization_application() { return $this->hasOne(ImmunizationApplication::class); } /** * Get the vaccination_review associated with the user. */ public function vaccination_review() { return $this->hasMany(VaccinationReview::class); } /** * Get the vaccination_review associated with the user. */ public function test_review() { return $this->hasMany(TestReview::class); } /** * Get the vaccination_review associated with the user. */ public function travel_authorization() { return $this->hasMany(TravelAuthorization::class); } }
[-] DynamicPage.php
[edit]
[-] TravelInformation.php
[edit]
[-] ImmunizationApplication.php
[edit]
[+]
..
[-] Country.php
[edit]
[-] TestReview.php
[edit]
[-] Help.php
[edit]
[-] BannerImage.php
[edit]
[-] StaticPage.php
[edit]
[-] ChecklistContent.php
[edit]
[-] VaccinationReview.php
[edit]
[-] Setting.php
[edit]
[-] ApiImage.php
[edit]
[-] Copyright.php
[edit]
[-] Contact.php
[edit]
[-] TravelAuthorization.php
[edit]
[-] Gallery.php
[edit]
[-] MembershipInformation.php
[edit]
[-] VaccinationReviewContent.php
[edit]
[-] Admin.php
[edit]
[-] Organization.php
[edit]
[-] User.php
[edit]
[-] SocialLink.php
[edit]
[-] LegalConsent.php
[edit]
[-] Reward.php
[edit]