<?php namespace App; use App\Bank\Payment; use App\Imali\RamoActivity; use App\Imali\RechargeImaliAccount; use Illuminate\Database\Eloquent\Model; class TransactionHistory extends Model { protected $fillable = [ 'transaction_type', 'status', 'visible', 'credelec_id', 'water_id', 'voucher_id', 'recharge_id', 'payment_id', 'transfer_id', 'transfer_history_id', 'money_request_id', 'user_id', 'category_id', 'created_at' ]; // 'created_at' function payments() { return $this->hasMany(Payment::class); } function payment() { return $this->belongsTo(Payment::class); } function vouchers() { return $this->hasMany(PurchaseVoucher::class); } function voucher() { return $this->belongsTo(PurchaseVoucher::class); } function transfersHistories() { return $this->hasMany(TransferHistory::class); } function transferHistory() { return $this->belongsTo(TransferHistory::class); } function waters() { return $this->hasMany(Water::class); } function water() { return $this->belongsTo(Water::class); } function credelecs() { return $this->hasMany(Credelec::class); } function credelec() { return $this->belongsTo(Credelec::class); } function recharges() { return $this->hasMany(RechargeImaliAccount::class); } function recharge() { return $this->belongsTo(RechargeImaliAccount::class); } function categories() { return $this->hasMany(RamoActivity::class); } function category() { return $this->belongsTo(RamoActivity::class); } function user(){ return $this->belongsTo(User::class); } }