Skip to content

Instantly share code, notes, and snippets.

@MartinTale
MartinTale / HasCompositePrimaryKeyTrait.php
Created December 18, 2019 02:10
Laravel trait to support composite primary keys in Eloquent models..
<?php
namespace App\Traits;
use Exception;
use Illuminate\Database\Eloquent\Builder;
trait HasCompositePrimaryKeyTrait
{
/**
How to add a start and exit portal
Make an exit portal in your game they can walk/fly/drive into, you can add a label like Vibe Jam Portal. This way players can play and go to the next game like a Vibe Jam 2026 Webring! Your game will be added if you have a portal.
And if they enter the portal it should redirect the page here (if it doesn't work yet no worries, I am building it then, will work when deadline hits! :D)
https://vibejam.cc/portal/2026
You can send GET query params (like ?username=bla&color=red&speed=0.2&ref=bla.com) that get forwarded like:
- username= (username/name of player)
- color= (color of player in hex or just red/green/yellow)