is('api/*')) { $user = app('Dingo\Api\Auth\Auth')->user(); } else { $user = auth()->user(); } return $user; } } if (!function_exists('company_date')) { /** * Format the given date based on company settings. * * @return string */ function company_date($date) { $date_time = new class() { use DateTime; }; return Date::parse($date)->format($date_time->getCompanyDateFormat()); } }