Skip to content

Instantly share code, notes, and snippets.

@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();
}
@mpijierro
mpijierro / download_csv.php
Last active October 28, 2024 06:45
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
*
@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;