Skip to content

Commit

Permalink
[Docs] Add v6 upgrade instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Mar 26, 2023
1 parent 3507a3a commit addbd4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight: 6
ALL upgrades of this package should follow these steps:

1. Upgrading between major versions of this package always require the usual Composer steps:
> 1. Update your `composer.json` to specify the new major version, such as `^5.0`
> 1. Update your `composer.json` to specify the new major version, such as `^6.0`
> 2. Then run `composer update`.
2. Compare the `migration` file stubs in the NEW version of this package against the migrations you've already run inside your app. If necessary, create a new migration (by hand) to apply any new changes.
Expand All @@ -17,6 +17,12 @@ ALL upgrades of this package should follow these steps:

5. Apply any version-specific special updates as outlined below...

### Upgrading to v6
If you have overridden the `getPermissionClass()` or `getRoleClass()` methods or have custom Models, you will need to revisit those customizations. See PR #2368 for details.
eg: if you have a custom model you will need to make changes, including accessing the model using `$this->permissionClass::` syntax (eg: using `::` instead of `->`) in all the overridden methods that make use of the models.
Be sure to compare your custom models with originals to see what else may have changed.

Also note that the migrations have been updated to anonymous-class syntax that was introduced in Laravel 8. You may optionally update your original migration files accordingly.

### Upgrading from v1 to v2
If you're upgrading from v1 to v2, there's no built-in automatic migration/conversion of your data to the new structure.
Expand Down

0 comments on commit addbd4f

Please sign in to comment.