*/ protected $fillable = [ 'name', 'email', 'password', 'work_start', 'work_end', ]; protected $guarded = ['id']; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; public function teams() { return $this->belongsToMany(Team::class); } public function timesheets() { return $this->hasMany(Timesheet::class); } public function subtasks() { return $this->hasMany(SubTask::class); } public static function getUserIdFromBearerToken($token) { $token = PersonalAccessToken::findToken($token); return $token->tokenable_id; } }