Marcel Pociot shared a tip on using the Laravel HTTP client method sink() to write a response to a file
The post 🔥 Download the Response of an HTTP Request in Laravel appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
24 June, 2023
23 June, 2023
JetBrains announced a bundle for Laravel developers: PhpStorm + Laravel Idea plugin
Programing Coderfunda
June 23, 2023
No comments
JetBrains, the company behind PhpStorm, has exciting news for Laravel developers. They have introduced a special bundle offer that includes PhpStorm and the Laravel Idea plugin at a 50% discount.
The post JetBrains announced a bundle for Laravel developers: PhpStorm + Laravel Idea plugin appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
22 June, 2023
Mock your API responses with ChatGPT
Programing Coderfunda
June 22, 2023
No comments
Hi guys,
We just recently launched a small package that allows you to dynamically mock API responses with ChatGPT to quickly jumpstart your project — basically seeders 2.0!
We'd love to hear some feedback and anything you'd like us to add to the package, and hopefully it saves you some time and spices up your mock responses.
https://github.com/yllw-digital/laravel-chatgpt-mock-api
Thanks! submitted by /u/zizipo
[link] [comments]
21 June, 2023
Laravel Tailwind Merge
Programing Coderfunda
June 21, 2023
No comments
Laravel Tailwind Merge is a package that automatically resolves Tailwind CSS class conflicts in Laravel Blade files.
The post Laravel Tailwind Merge appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
20 June, 2023
Lemon Squeezy for Laravel 1.0 is Here
Programing Coderfunda
June 20, 2023
No comments
The Lemon Squeezy for Laravel package released v1.0. Learn about this exciting package to make subscription billing, payments, and license keys a breeze!
The post Lemon Squeezy for Laravel 1.0 is Here appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
19 June, 2023
Get max and min value's unique id while using group by
Programing Coderfunda
June 19, 2023
No comments
I have a table with columns: unique_id, product, root_location, price with more than 50 million records
I want the result to be product, min_price, min_price_unique_id, max_price, max_price_unique_id
My query:
select product
, min(price) as min_price
, max(price) as max_price
from mytable
group by product
How to get the unique id's of min and max price?
18 June, 2023
Sending files in blocks
Programing Coderfunda
June 18, 2023
No comments
I have a problem with sending an Excel file in blocks. I have this code that is supposed to send the Excel file in blocks, and it works fine up to a certain point. However, the issue is that it only writes the first 100 records. After that, the file size remains the same as if it had all 10,000 records, but when opened, it only has 100 records.
@Override
public void generateAndSendExcelChunks(ServletOutputStream outputStream) throws IOException {
Workbook workbook = new SXSSFWorkbook();
Sheet sheet = workbook.createSheet("Datos");
int totalRows = 10000;
int rowsPerChunk = 100;
int currentRow = 0;
while (currentRow < totalRows) {
int endRow = currentRow + rowsPerChunk;
endRow = Math.min(endRow, totalRows);
generateChunkData(sheet, currentRow, endRow);
workbook.write(outputStream);
outputStream.flush();
sheet = workbook.createSheet("Datos");
currentRow = endRow;
}
workbook.close();
}
private void generateChunkData(Sheet sheet, int startRow, int endRow) {
for (int i = startRow; i < endRow; i++) {
Row row = sheet.createRow(i);
Cell cell = row.createCell(0);
cell.setCellValue("Valor " + (i + 1));
}
}
The line sheet = workbook.createSheet("Datos"); doesn't work because it tries to create a sheet with a name that already exists. If I try to get a reference to that sheet, it gives a "stream closed" error on this line: workbook.write(outputStream);. The intended functionality is to store all the information in the same sheet without overwriting anything.

.png)

