<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Scopes\MessageScope;

class EpfFailureLog extends Model
{
    use SoftDeletes;
    protected $table = 'epf_failure_logs';

    public function getEpfFailureLogsbyApplication($id){
        $response['epf']  = $this->whereNull('deleted_at')
            ->where('application_id', $id)
            ->where('applicant_type', 1)
            ->latest('created_at')
            ->first();
        $response['epfCoApplicant'] = $this->whereNull('deleted_at')
            ->where('application_id', $id)
            ->where('applicant_type', 2)
            ->latest('created_at')
            ->first();
        return $response;
    }
}