Skip to content

Instantly share code, notes, and snippets.

View TwilightDuck's full-sized avatar
🎯
Focusing

TwilightDuck TwilightDuck

🎯
Focusing
View GitHub Profile
@TwilightDuck
TwilightDuck / HasCompositePrimaryKey.php
Last active September 30, 2020 18:35
Trait that enables a Eloquent model to have Composite Keys.
<?php
namespace App\Traits;
use RuntimeException;
trait HasCompositePrimaryKey
{
public function getIncrementing(): bool
{
### Keybase proof
I hereby claim:
* I am NickJorens on github.
* I am nickjorens (https://keybase.io/nickjorens) on keybase.
* I have a public key whose fingerprint is 4555 5970 447B F787 EA72 E5D4 95CD 54A6 A4A8 C590
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am nickjorens on github.
  • I am nickjorens (https://keybase.io/nickjorens) on keybase.
  • I have a public key ASCYCBlTjivZh_QqDDFjGuxTxTLWUQ-adIRlcq_ApjLN2Ao

To claim this, I am signing this object: