Skip to content

Instantly share code, notes, and snippets.

View timacdonald's full-sized avatar

Tim MacDonald timacdonald

View GitHub Profile
@timacdonald
timacdonald / ContactIndexResponse.php
Last active February 9, 2023 21:48
Easily respond to content types and url extensions
<?php
namespace App\Http\Responses;
use App\Models\ContactType;
use App\Factories\CsvFactory;
class ContactIndexResponse extends Response
{
public function __construct($contacts)
@timacdonald
timacdonald / existing.md
Last active May 4, 2018 07:57
existing.md
Trial Trial + Cancelled Recurring Recurring + Cancelled Cancelled [ended]
onTrial()
active()
valid()
cancelled()
onGracePeriod()
@timacdonald
timacdonald / proposed.md
Last active May 4, 2018 08:38
Proposed
Trial Trial + Cancelled Recurring Recurring + Cancelled Cancelled [ended]
ended()
resumable()
activelyRecurring()
@timacdonald
timacdonald / Builder.php
Last active April 19, 2019 23:09
Basic Search
<?php
namespace App\Builders;
use Illuminate\Database\Eloquent\Builder as BaseBuilder;
class Builder extends BaseBuilder
{
public function search($term, $attributes)
{
@timacdonald
timacdonald / transducers.php
Last active December 13, 2021 08:30
Transducers
<?php
declare(strict_types=1);
namespace Transducers;
use Closure;
function compose(array $reducers): Closure
{