Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 15 |
CRAP | |
0.00% |
0 / 15 |
| UserDetail | |
0.00% |
0 / 1 |
|
0.00% |
0 / 15 |
240 | |
0.00% |
0 / 15 |
| user | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| organisation | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| departments | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| teams | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| role | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| shifts | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| userAddress | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| userBankdetail | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| userDocumentdetail | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| attendanceRequests | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| leaveDetail | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| secondaryManager | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| primaryTeamName | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| primaryReportingManager | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| notifictions | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace App\Models\Admin; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Notifications\Notifiable; | |
| use App\Models\Admin\Department; | |
| use App\Models\Admin\Team; | |
| use App\Models\Admin\Organisation; | |
| use App\Models\Admin\UserAddress; | |
| use App\Models\Admin\UserBankDetail; | |
| use App\Models\Admin\UserDocumentDetail; | |
| use App\Models\Admin\attendanceRequest; | |
| use App\Models\Admin\Leave; | |
| use Spatie\Permission\Models\Role; | |
| use OwenIt\Auditing\Contracts\Auditable; | |
| use App\Models\Auth\User; | |
| use Illuminate\Database\Eloquent\SoftDeletes; | |
| use Spatie\Permission\Traits\HasRoles; | |
| use Laravel\Passport\HasApiTokens; | |
| use App\Models\NotificationModel\NotificationList; | |
| class UserDetail extends Model implements Auditable | |
| { | |
| use Notifiable, HasRoles, HasApiTokens; | |
| use SoftDeletes; | |
| use \OwenIt\Auditing\Auditable; | |
| protected $fillable = [ | |
| 'personal_email', | |
| 'gender', | |
| 'dob', | |
| 'mobile_number', | |
| 'orgainsation_id', | |
| 'role_id', | |
| 'user_id', | |
| 'biometric_id', | |
| 'employee_id', | |
| 'primary_reporting_manager_id', | |
| 'primary_team_id' | |
| ]; | |
| public function user() | |
| { | |
| return $this->belongsTo(User::class); | |
| } | |
| public function organisation() | |
| { | |
| return $this->belongsTo(Organisation::class); | |
| } | |
| public function departments() | |
| { | |
| return $this->belongsToMany(Department::class); | |
| } | |
| public function teams() | |
| { | |
| return $this->belongsToMany(Team::class); | |
| } | |
| public function role() | |
| { | |
| return $this->hasOne(Role::class, 'foreign_key'); | |
| //return $this->hasOne(Role::class); | |
| } | |
| public function shifts() | |
| { | |
| return $this->belongsToMany(Shift::class); | |
| } | |
| public function userAddress() | |
| { | |
| return $this->hasOne(UserAddress::class); | |
| } | |
| public function userBankdetail() | |
| { | |
| return $this->hasOne(UserBankDetail::class); | |
| } | |
| public function userDocumentdetail() | |
| { | |
| return $this->hasOne(UserDocumentDetail::class); | |
| } | |
| public function attendanceRequests() | |
| { | |
| return $this->belongsToMany(attendanceRequest::class); | |
| } | |
| public function leaveDetail() | |
| { | |
| return $this->hasOne(Leave::class); | |
| } | |
| public function secondaryManager() | |
| { | |
| return $this->belongsToMany(User::class); | |
| } | |
| public function primaryTeamName() | |
| { | |
| return $this->belongsTo(Team::class, 'primary_team_id', 'id'); | |
| } | |
| public function primaryReportingManager() | |
| { | |
| return $this->belongsTo(User::class, 'primary_reporting_manager_id', 'id'); | |
| } | |
| //added the notification function here | |
| public function notifictions() | |
| { | |
| return $this->belongsToMany(NotificationList::class); | |
| } | |
| } |