tighten / parental

Use single table inheritance in your Laravel app
MIT License
1.36k stars 98 forks source link

Documentation out of date #34

Closed julianpoma closed 5 years ago

julianpoma commented 5 years ago

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

julianpoma commented 5 years ago

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

See issue #27

calebporzio commented 5 years ago

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

julianpoma commented 5 years ago

Thanks!

angristan commented 5 years ago

I am on 0.7 and I also have:

Trait 'App\Tightenco\Parental\HasChildren' not found
angristan commented 5 years ago

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.