Skip to content

Instantly share code, notes, and snippets.

@ragasubekti
Created August 6, 2018 12:25
Show Gist options
  • Save ragasubekti/43aab2f501241ad047a97620c7682801 to your computer and use it in GitHub Desktop.
Save ragasubekti/43aab2f501241ad047a97620c7682801 to your computer and use it in GitHub Desktop.
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class Kantor extends Model
{
protected $table = 'master_kantor';
public $timestamps = false;
public function child() {
return $this->hasMany('App\Model\Kantor', 'kodeParent', 'kode');
}
public function childRecursive() {
return $this->child()->with('childRecursive');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment