<?php

namespace Server\Database\Models;

use Illuminate\Database\Eloquent\Model;

class Trader extends Model
{

    protected $fillable = [
        'name',
        'type',
        'price',
        'email',
        'photo',
        'win_rate',
        'description',
        'profit_share',
    ];

    protected $hidden = [
        'created_at',
        'updated_at'
    ];

    public function trades()
    {
        return $this->hasMany(Trade::class)->orderBy('created_at', 'DESC');
    }

    public function followers()
    {
        return $this->belongsToMany(User::class);
    }
}