<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserStaking extends Model {
    protected $dates = ['started_at','ends_at','last_reward_paid_at'];
    protected $fillable = ['user_id','staking_plan_id','coin_id','amount','started_at','ends_at','last_reward_paid_at','status','reward_accumulated'];

    public function plan(){ return $this->belongsTo(StakingPlan::class,'staking_plan_id'); }
    public function user(){ return $this->belongsTo(User::class); }
    public function rewards(){ return $this->hasMany(StakingReward::class); }
}
