E por que não criar apenas uma entidade?
Migration:
Schema::create('categories', function($table)
{
$table->increments('id');
$table->integer('parent_id')->nullable();
$table->string('name');
$table->boolean('inactive')->default(0);
$table->timestamps();
$table->engine = 'InnoDB';
});
Relacionamentos:
/**
* Define an inverse one-to-one or many relationship.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function parent()
{
return $this->belongsTo('Category', 'parent_id');
}
/**
* Define a one-to-many relationship.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function children()
{
return $this->hasMany('Category', 'parent_id');
}
Para criar e atribuir:
$parent = new Category;
$parent->name = 'Parent';
$parent->save();
$child = new Category(['name' = 'Child']);
$parent->children()->save($child);
Fica mais simples!