<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Reward extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'rewards';
    protected $dates = ['deleted_at'];

    public function milestones()
    {
        return $this->belongsToMany(Milestone::class, MilestoneReward::class);
    }

    /**
     * @return HasMany
     */
    public function users(): HasMany
    {
        return $this->HasMany(UserReward::class, 'reward_id', 'id');
    }
}
