<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Transaction extends Model
{
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function member()
{
return $this->belongsTo(member::class, 'member_id');
}
// public function scopeCheckMember($id, $month)
// {
// if ($this->whereMonth('created_at', $month)->first() != null) {
// return "A";
// } else {
// return $this->whereMonth('created_at', $month)->first()->type;
// }
// }
use HasFactory;
protected $table = 'xyz_transactions';
protected $fillable = ['date', 'type', 'amount', 'description', 'token', 'status', 'user_id', 'member_id'];
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]