Skip to content

2.0.0

Compare
Choose a tag to compare
@d8vjork d8vjork released this 29 Sep 15:31
· 199 commits to main since this release
67c22ed

⚠️ Please make sure to run php artisan vendor:publish --force --provider="OpenSoutheners\LaravelApiable\ServiceProvider" ⚠️

Removed

  • JsonApiResponse::list and JsonApiResponse::getOne methods as isn't the responsibility of this package to act as query repository so it makes easier to encapsulate it into repository or whatever design pattern you're using. Use JsonApiResponse::using instead sending the query as its parameter.

Added

  • PHP 8 attributes for QueryParams:
    • OpenSoutheners\LaravelApiable\Attributes\FilterQueryParam
    • OpenSoutheners\LaravelApiable\Attributes\IncludeQueryParam
    • OpenSoutheners\LaravelApiable\Attributes\AppendsQueryParam
    • OpenSoutheners\LaravelApiable\Attributes\FieldsQueryParam
    • OpenSoutheners\LaravelApiable\Attributes\SortQueryParam
    • OpenSoutheners\LaravelApiable\Attributes\SearchQueryParam
  • Method JsonApiResponse::from can now be non-statically called as JsonApiResponse::using (for dependency injection usage in controllers, etc)

Changed

  • Config file changes. Please make sure to run php artisan vendor:publish --force --provider="OpenSoutheners\LaravelApiable\ServiceProvider"
  • Constructor from JsonApiResponse now only accepts 1 optional parameter (being the query parameter removed in favor of manually setting this by calling JsonApiResponse::using method)
  • Constructor from RequestQueryObject now only accepts 1 optional parameter (being the query parameter removed in favor of manually setting this by calling RequestQueryObject::setQuery method)