<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;

class SPMotorPannaBit extends Model
{
      use Notifiable , SoftDeletes;

 # define table
  protected $table ='sp_motor_panna_bits';
  
  # define fillable fields
  protected $fillable = [
  	                   'user_id',
  	                   'sp_motor_bit_id',
  	                   'bit_place',
  	                   'amount',
  	                   'status',
  	                   'bit_id',
                       'payment_new_history_id'
                       
  ];

     /**
   * The attributes that should be cast.
   *
   * @var array
   */
  protected $casts = [
      'status'  => 'boolean',
  ];
  public function bit()
    {
       
        return $this->hasOne(new Bit(), 'id', 'bit_id');
    }
   
     public function username()
    {
       
        return $this->hasOne('App\User', 'id', 'user_id');
    }
     public function SPMotor()
    {
       
        return $this->hasOne(new SpMotorBit(), 'id', 'sp_motor_bit_id');
    }
}