Skip to content

Instantly share code, notes, and snippets.

View q10242's full-sized avatar

CompanionCube q10242

  • Taiwan ,Taipei
View GitHub Profile
@stevebauman
stevebauman / IsSelfReferencing.php
Last active June 20, 2023 01:13
Laravel model trait for easily adding self-referential tables
<?php
namespace App;
use Illuminate\Database\Eloquent\Builder;
trait IsSelfReferencing
{
/**
* The self referencing key on the database table.