Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #comparison #tables #laravel #model
ADD COMMENT
Topic
Name
7+2 =