PATH:
home
/
lab2454c
/
.trash
/
core
/
app
/
Models
<?php namespace App\Models; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Carbon\Carbon; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { use Notifiable, HasApiTokens; /** * The attributes that are mass assignable. * * @var array */ protected $guarded = ['id']; /** * 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', 'address' => 'object', 'ver_code_send_at' => 'datetime' ]; protected $data = [ 'data'=>1 ]; public function login_logs() { return $this->hasMany(UserLogin::class); } public function transactions() { return $this->hasMany(Transaction::class)->orderBy('id','desc'); } public function deposits() { return $this->hasMany(Deposit::class)->where('status','!=',0); } public function withdrawals() { return $this->hasMany(Withdrawal::class)->where('status','!=',0); } // SCOPES public function getFullnameAttribute() { return $this->firstname . ' ' . $this->lastname; } public function scopeActive() { return $this->where('status', 1); } public function scopeBanned() { return $this->where('status', 0); } public function scopeEmailUnverified() { return $this->where('ev', 0); } public function scopeSmsUnverified() { return $this->where('sv', 0); } public function scopeEmailVerified() { return $this->where('ev', 1); } public function scopeSmsVerified() { return $this->where('sv', 1); } public function product() { return $this->hasMany(Product::class, 'user_id')->where('status', 1)/*->whereDate('time_duration','>', Carbon::now()->toDateTimeString())*/; } public function showcases() { return $this->hasMany(Showcase::class); } public function collections() { return $this->hasMany(Collection::class); } public function category() { return $this->belongsTo(Category::class, 'category_id'); } public function subCategory() { return $this->belongsTo(SubCategory::class, 'sub_category_id'); } public function favouriteTeam() { return $this->belongsTo(SubCategory::class, 'favourite_team_id'); } public function orders() { return $this->hasMany(Order::class); } public function fashionNfts() { return $this->hasMany(FashionNft::class); } }
[-] GeneralSetting.php
[edit]
[-] DynamicPage.php
[edit]
[-] Showcase.php
[edit]
[-] AdminPasswordReset.php
[edit]
[-] WithdrawMethod.php
[edit]
[-] HomeImage.php
[edit]
[-] Language.php
[edit]
[-] Review.php
[edit]
[-] EmailLog.php
[edit]
[-] ProductContent.php
[edit]
[+]
..
[-] FashionNftImage.php
[edit]
[-] EmailTemplate.php
[edit]
[-] Frontend.php
[edit]
[-] AdminNotification.php
[edit]
[-] Extension.php
[edit]
[-] GatewayCurrency.php
[edit]
[-] Category.php
[edit]
[-] Order.php
[edit]
[-] SupportTicket.php
[edit]
[-] SupportMessage.php
[edit]
[-] Withdrawal.php
[edit]
[-] UserLogin.php
[edit]
[-] SmsTemplate.php
[edit]
[-] Brand.php
[edit]
[-] Contact.php
[edit]
[-] PasswordReset.php
[edit]
[-] Page.php
[edit]
[-] Advertisement.php
[edit]
[-] Transaction.php
[edit]
[-] ProductSpecification.php
[edit]
[-] SupportAttachment.php
[edit]
[-] FashionNft.php
[edit]
[-] Product.php
[edit]
[-] Specification.php
[edit]
[-] ProductReport.php
[edit]
[-] Gateway.php
[edit]
[-] Subcategory.php
[edit]
[-] Admin.php
[edit]
[-] Deposit.php
[edit]
[-] MomentContent.php
[edit]
[-] User.php
[edit]
[-] ContactReply.php
[edit]
[-] ProductImage.php
[edit]
[-] FaqContent.php
[edit]
[-] Collection.php
[edit]