72 lines
2.1 KiB
PHP
72 lines
2.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Frontend;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use App\Models\Admin\country;
|
||
|
|
use App\Models\Admin\program;
|
||
|
|
use App\Models\Frontend\volunteer_profile_document;
|
||
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||
|
|
use App\Models\Frontend\payment_transaction_master;
|
||
|
|
|
||
|
|
|
||
|
|
class User extends Authenticatable
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
protected $table = 'iam_principal';
|
||
|
|
|
||
|
|
public function paymentTransactions()
|
||
|
|
{
|
||
|
|
return $this->hasMany(payment_transaction_master::class,'principal_xid');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function user_documents()
|
||
|
|
{
|
||
|
|
return $this->hasMany(volunteer_profile_document::class,'principal_xid');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function country()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(country::class,'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function get_single_country()
|
||
|
|
{
|
||
|
|
return $this->hasOne(country::class,'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function get_sngle_program()
|
||
|
|
{
|
||
|
|
return $this->hasOne(program::class,'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
protected $guarded = ['id',
|
||
|
|
'first_name',
|
||
|
|
'last_name',
|
||
|
|
'email',
|
||
|
|
'email_verified_at',
|
||
|
|
'password',
|
||
|
|
'programs_xid',
|
||
|
|
'country_xid',
|
||
|
|
'start_date',
|
||
|
|
'duration',
|
||
|
|
'phone_number',
|
||
|
|
'gender',
|
||
|
|
'date_of_birth',
|
||
|
|
'address_line1',
|
||
|
|
'city',
|
||
|
|
'country',
|
||
|
|
'state',
|
||
|
|
'post_code',
|
||
|
|
'lang_level',
|
||
|
|
'hear_about_us',
|
||
|
|
'motivation_to_join_program',
|
||
|
|
'any_comment',
|
||
|
|
'created_at',
|
||
|
|
'updated_at'];
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|