PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use App\Models\Settings;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens;
use HasFactory;
use HasProfilePhoto;
use Notifiable;
use TwoFactorAuthenticatable;
/**
* Send the email verification notification.
*
* @return void
*/
public function sendEmailVerificationNotification()
{
$settings = Settings::where('id', 1)->first();
if ($settings->enable_verification == 'true') {
$this->notify(new VerifyEmail);
}
}
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'l_name', 'email', 'phone', 'country', 'password',
'ref_by', 'status','taxamount ','username',
'email_verified_at','gender', 'account',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password',
'remember_token',
'two_factor_recovery_codes',
'two_factor_secret',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
'account' => 'array', // Automatically convert JSON to array when retrieving
'last_auto_trade_at' => 'datetime',
];
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = [
'profile_photo_url',
];
public function dp()
{
return $this->hasMany(Deposit::class, 'user');
}
public function wd()
{
return $this->hasMany(Withdrawal::class, 'user');
}
public function copyTrades()
{
return $this->hasMany(CopyTrade::class);
}
public function isCopyingExpert($expertId)
{
return $this->copiedExperts()->where('expert_id', $expertId)->exists();
}
public function trades()
{
return $this->hasMany(Trade::class);
}
public function copiedExperts()
{
return $this->hasMany(Copy::class);
}
public function tuser()
{
return $this->belongsTo(Admin::class, 'assign_to');
}
public function dplan()
{
return $this->belongsTo(Plans::class, 'plan');
}
public function plans()
{
return $this->hasMany(User_plans::class, 'user', 'id');
}
public static function search($search): \Illuminate\Database\Eloquent\Builder
{
return empty($search) ? static::query()
: static::query()->where('id', 'like', '%' . $search . '%')
->orWhere('name', 'like', '%' . $search . '%')
->orWhere('username', 'like', '%' . $search . '%')
->orWhere('email', 'like', '%' . $search . '%');
}
}
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E