Answers for "comparison of two tables in laravel using model"

PHP
0

comparison of two tables in laravel using model

$paidFeesIds = Fee::whereHas('paidFees', function($q) {
    $q->where('payment_status', 1);
})->pluck('id')->toArray();

$notPaidFeesIds = Fee::whereNotIn('id', $paidFeesIds)->pluck('id')->toArray();
Posted by: Guest on July-16-2020
0

comparison of two tables in laravel using model

public function paidFees()
{
    return $this->hasMany(PaidFees::class, 'fee_id');
}
Posted by: Guest on July-16-2020

Code answers related to "comparison of two tables in laravel using model"

Browse Popular Code Answers by Language