-
-
Notifications
You must be signed in to change notification settings - Fork 97
Upgrading
Max edited this page Jun 10, 2019
·
9 revisions
- Improvements to the make:api-resource command - in particular, with regards to example routes.
Helpers are no longer in the global namespace, have been moved to L5Api\Helpers
- Two model properties were changed to non-static to better reflect how existing similar Laravel model properties work;
- The model static property $localWith has been changed to a non-static
- The model static property $transformer has been changed to non-static
- There is a new policy ability called viewAll which is checked for the getAll endpoint, which is used for the GET / (collection) requests. With this addition, it is important that this ability be added to the policies you have. The easiest way to deal with this change is just to add this function to your BasePolicy - which mimics previous functionality.
public function viewAll(User $user)
{
return true;
}
This was added to make the viewing of all resources of a model (as opposed to individual ones) more configurable at the resource/model policy level.
- RestfulChildController changes to $parentAbilitiesRequired array The view permission on a given resource has been changed from requiring own to view on the parent resource. This was deemed more sensible from a design point of view. Keep in mind, this array is entirely configurable at the controller class.
public $parentAbilitiesRequired = [
'view' => 'view', // Previously 'own'
....