Viewing file: User.php (2.68 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable { /** @use HasFactory<\Database\Factories\UserFactory> */ use HasApiTokens, HasFactory, Notifiable, HasRoles;
/** * The attributes that are mass assignable. * * @var list<string> */ protected $fillable = [ 'name', 'email', 'password', 'type', 'two_factor_enabled', 'two_factor_secret', 'password_changed_at', 'account_deletion_requested_at', ];
/** * The attributes that should be hidden for serialization. * * @var list<string> */ protected $hidden = [ 'password', 'remember_token', 'two_factor_secret', ];
/** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } /** * Get the campaigns for the user. */ public function campaigns(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(Campaign::class); }
/** * Get the wallet for the user. */ public function wallet(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Wallet::class); }
/** * Get the user's preferences. */ public function preference(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(UserPreference::class); }
/** * Get the user's notification settings. */ public function notificationSetting(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(NotificationSetting::class); }
/** * Get the user's payment methods. */ public function paymentMethods(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(PaymentMethod::class); }
/** * Get the user's recovery codes. */ public function recoveryCodes(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(RecoveryCode::class); }
/** * Get the HilltopAds account assigned to this user. */ public function hilltopAccount(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(HilltopAccount::class, 'assigned_user_id'); }
}
|