Skip to content

Instantly share code, notes, and snippets.

@TheNodi
TheNodi / InteractsWithScout.php
Created July 6, 2017 17:19
Manages Laravel Scout in tests
<?php
namespace Tests\Concerns;
use Laravel\Scout\EngineManager;
/**
* Manages Laravel Scout in tests.
*
* This trait saved me about 40% test runtime on a relative
@TheNodi
TheNodi / HashidsRoutable.php
Last active June 15, 2023 23:18
Laravel Model Bindings with Hashids
<?php
namespace App;
use Vinkla\Hashids\HashidsManager;
/**
* Bind a model to a route based on the hash of
* its id (or other specified key).
*