Rubenwouters\CrmLauncher\Models\Log::secondsago PHP 메소드

secondsago() 공개 메소드

Check seconds between previous API call & now
public secondsago ( $type ) : integer
리턴 integer
    public function secondsago($type)
    {
        if (Log::where('case_type', $type)->exists()) {
            $now = Carbon::now();
            $last = Log::LatestLog($type);
            $lastLog = new Carbon($last);
            return $now->diffInSeconds($lastLog);
        }
        return false;
    }