File Manager

Path: /home/liffinac1/domains/impactxtmtrading.com/private_html/app/Models/

Viewing File: Trade.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Trade extends Model
{
    protected $fillable = [
        'user_id',
        'instrument_id',
        'amount',
        'direction', // 'buy' or 'sell'
        'entry_price',
        'exit_price',
        'status', // 'open', 'closed'
        'pnl',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function instrument()
    {
        return $this->belongsTo(Instrument::class);
    }
}