<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class InvestmentPlan extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'amount_invested',
        'min_amount',
        'bonus_per_downline',
        'number_of_downlines',
        'total_earning',
        'initial_earning',
        'duration',
        'amount_per_hour',
        'category_id',
        'instant_reward',
        'image'
    ];

    public function investments(){
        return $this->hasMany(Investment::class);
    }

      /**
     * Get the category that owns the Plan
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function category()
    {
        return $this->belongsTo(Category::class);
    }
}
