Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\CampFormats;
use App\Actions\CopyPdfFromResources;
use App\Actions\CreateRosterPdf;
use App\Actions\GetGoogleDocAsPdf;
class BasketballOneDay extends BaseFormat
{
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'assign_null_coalescing_to_coalesce_equal' => true,
'binary_operator_spaces' => [
@edgrosvenor
edgrosvenor / Exportable.php
Created February 20, 2022 02:14
Zero effort export to csv for Eloquent models
<?php
namespace App\Traits;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use ReflectionClass;
trait Exportable
{
@edgrosvenor
edgrosvenor / RunPlanetScaleMigrations.php
Created September 28, 2022 09:39
The current state of my attempt to fully automate migrations upon deployment with PlanetScale
<?php
namespace App\Console\Commands\CI;
use App\Support\PlanetScale\CategorizeMigrations;
use App\Support\PlanetScale\ConnectToBranch;
use App\Support\PlanetScale\CreateBranch;
use App\Support\PlanetScale\CreateDeployRequest;
use App\Support\PlanetScale\DeleteBranch;
use App\Support\PlanetScale\DeployRequest;
@edgrosvenor
edgrosvenor / Raffle.php
Last active July 17, 2024 19:12
Kind of like the Laravel Lottery helper, but with unlimited outcomes
<?php
use Illuminate\Support\Collection;
class Raffle
{
private int $total = 0;
private int $current = 0;
private Collection $entries;