private static function exportStatementToCsv($results) { return ["content" => CsvFileService::toCsv($results, '"' . join('","', PayeePayment::$PAYMENT_CSV_HEADER) . '"', '', ','), "content_type" => "text/csv", "filename" => "unpaidStatements.csv"]; }
public static function apiNoEmailUsers() { $results = PayeeCompany::payeesWithoutEmail()->select(["user.id", "user.name", "user.code", "user.email"])->get()->toArray(); return ["content" => CsvFileService::toCsv($results, "id,name,code,email,password"), "content_type" => "text/csv", "filename" => "noEmailUsers.csv"]; }
public static function apiCsv() { $results = self::paymentsPerPayee(Auth::user()["code"])->select(self::downloadHeader())->get()->toArray(); return ["content" => CsvFileService::toCsv($results, implode(",", self::downloadHeader())), "content_type" => "text/csv", "filename" => "payments.csv"]; }