comparison of two tables in laravel using model

Solutions on MaxInterview for comparison of two tables in laravel using model by the best coders in the world

showing results for - "comparison of two tables in laravel using model"
Julien
06 Mar 2016
1$paidFeesIds = Fee::whereHas('paidFees', function($q) {
2    $q->where('payment_status', 1);
3})->pluck('id')->toArray();
4
5$notPaidFeesIds = Fee::whereNotIn('id', $paidFeesIds)->pluck('id')->toArray();
Claudia
03 Feb 2020
1public function paidFees()
2{
3    return $this->hasMany(PaidFees::class, 'fee_id');
4}