Rubenwouters\CrmLauncher\Models\Log::secondsago PHP Method

secondsago() public method

Check seconds between previous API call & now
public secondsago ( $type ) : integer
return 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;
    }