- Find all
Cog\Contracts\Laravel\Ownership
and replace withCog\Contracts\Ownership
- Find all
Cog\Ownership\Contracts\HasOwner
and replace withCog\Contracts\Laravel\Ownership\Ownable
- Find all
Cog\Ownership\Observers\ModelObserver
and replace withCog\Laravel\Ownership\Observers\OwnableObserver
- Find all
Cog\Ownership\Contracts
and replace withCog\Contracts\Laravel\Ownership
- Find all
Cog\Ownership
and replace withCog\Laravel\Ownership
You need to upgrade only if you have models with Strict Ownership and you are using default owned_by
column names.
- Rename database columns
owned_by
toowned_by_id
for all the ownable models with strict ownership. - If you have raw DB queries - don't forget to modify them as well.
You are able to keep old naming without any database changes. Overwrite foreign keys in ownable models by adding $ownerForeignKey
property:
protected $ownerForeignKey = 'owned_by';