tighten / parental

Use single table inheritance in your Laravel app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation out of date

julianpoma opened this issue · comments

I installed the package doing composer require "tightenco/parental=0.5"

The trait names are not longer valid? When I use HasParent or HasChildren trait I get an error saying:

Trait 'Tightenco\Parental\HasParent' not found

I had to use the following ones:

use \Tightenco\Parental\HasParentModel and use \Tightenco\Parental\ReturnsChildModels;

Another issue: custom aliases doesn't work. I put this on my parent model:

protected $childTypes = [
        'order' => App\Order::class,
        'comeback' => App\Comeback::class,
    ];

And on my table, I get App\Order and App\Comeback as a type

Ok, it's the other way around. Doc is OK, but latest release v0.5.1 has not been tagger

See issue #27

@julianpoma - everything should be all set now if you upgrade to: v0.6

Thanks!

I am on 0.7 and I also have:

Trait 'App\Tightenco\Parental\HasChildren' not found

OK it's because I was missing the leading \:

use Tightenco\Parental\HasParent;

to

use \Tightenco\Parental\HasParent;

I don't know if that's intended in the README.