Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 6
User
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
42
0.00% covered (danger)
0.00%
0 / 6
 userdetail
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 leavelog
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 userdetailWithTeam
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 notifictions
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 routeNotificationForSlack
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 userReportingEmployee
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
namespace App\Models\Auth;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
use App\Models\Admin\UserDetail;
use Illuminate\Database\Eloquent\SoftDeletes;
use OwenIt\Auditing\Contracts\Auditable;
use App\Notifications\SubscriptionRenewalFailed;
use App\Models\NotificationModel\NotificationList;
use Laravel\Passport\HasApiTokens;
use App\Models\Admin\UserDetailUser;
use App\Models\Leave\LeaveLogs;
class User extends Authenticatable implements Auditable
{
    use Notifiable,HasRoles,HasApiTokens;
    use  SoftDeletes;
    use  \OwenIt\Auditing\Auditable;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];
    /**
     * 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',
    ];
    public function userdetail()
    {
        return $this->hasOne(UserDetail::class);
    }
    public function leavelog()
    {
        return $this->hasMany(LeaveLogs::class);
    }
    public function userdetailWithTeam()
    {
        return $this->hasOne(UserDetail::class)->with('teams');
    }
    public function notifictions()
    {
        return $this->belongsToMany(NotificationList::class);
    }
    /**
     * Route notifications for the Slack channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForSlack($notification)
    {
        return  config('app.slack_webhook');
    }
    public function userReportingEmployee()
    {
        return $this->hasMany(UserDetailUser::class);
    }
}