Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
nasrulhazim / SeedingProgressBar.php
Last active October 25, 2019 08:30
Added Progress Bar on Seeding
<?php
namespace App\Traits;
trait SeedingProgressBar
{
public function run()
{
$seeders = $this->seeders;
@mpijierro
mpijierro / download_csv.php
Last active January 15, 2024 10:46
Example streaming large CSV files with Laravel and thousands of queries
<?php
namespace Src\Csv;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class DownloadLargeCsv
*
@agbishara
agbishara / Generate CSV from mysql and email out.php
Last active May 7, 2024 12:05
Generate CSV from mysql and email out
<?php
//src: http://stackoverflow.com/questions/10334753/how-to-send-an-email-with-a-csv-attachment-from-a-string
//mysql user variables
$mysqli = new mysqli("localhost", "user", "password", "database");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}