Skip to content

Instantly share code, notes, and snippets.

@ddavaham
Created January 13, 2019 13:52
Show Gist options
  • Save ddavaham/9c085d31cb844c7354ed2a1977129efc to your computer and use it in GitHub Desktop.
Save ddavaham/9c085d31cb844c7354ed2a1977129efc to your computer and use it in GitHub Desktop.
<?php
namespace SUN\Models\ESI;
use Illuminate\Database\Eloquent\Model;
class Type extends Model
{
...
public function skillz()
{
return $this->belongsToMany(Type::class, 'type_skillz', 'type_id', 'skill_id');
}
public function p_types ()
{
return $this->belongsToMany(Type::class, 'type_skillz', 'skill_id', 'type_id');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment