<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use Notifiable, SoftDeletes; 

    protected $fillable = [
        'name','email','password','role','is_active','activation_token','activation_expires_at'
    ];

    protected $hidden = ['password','remember_token'];

    public function assignedTasks()
{
    return $this->belongsToMany(\App\Models\Task::class, 'task_assignees')
        ->withPivot(['assigned_by','assigned_at'])
        ->withTimestamps();
}

}
