Skip to content

Releases: open-southeners/laravel-apiable

2.3.0

24 Oct 14:50
996b785
Compare
Choose a tag to compare

Added

  • Conditionally filter out attributes that ends with "_id" (adding config option responses.include_ids_on_attributes)
  • JsonApiResponse::includingIdAttributes() method for setting responses.include_ids_on_attributes option value within an individual response

2.2.3

20 Oct 17:12
6ec2c75
Compare
Choose a tag to compare

Fixed

  • Fix resolveFromRoute when using invokable controller JsonApiResponse

2.2.2

20 Oct 09:56
b6e4330
Compare
Choose a tag to compare

Fixed

  • JsonApiResponse::toArray returning wrong formatted JSON:API array

2.2.1

19 Oct 11:25
1bb7e9e
Compare
Choose a tag to compare

Fixed

  • JsonApiResponse::forceAppend method fails getting model class when from query builder

2.2.0

18 Oct 15:22
ca70bad
Compare
Choose a tag to compare

Added

  • requests.validate_params config option to apiable.php for enforcing validation. Requires to publish or manually copy [#7]
  • Additional filter operators like gte (greater or equal than), gt (greater than), lte (lower or equal than), lt (lower than) [#5]

Changed

  • Get allowed fields methods from apply query params pipeline classes moved to OpenSoutheners\LaravelApiable\Http\QueryParamsValidator
  • Operators from allowed_filters included to meta data are now URL-safe
  • allowed_sorts structure is now based on ['attribute' => 'allowed_direction']
  • Allow filters methods/attribute now accepts array with multiple operators

2.1.1

06 Oct 13:14
f927708
Compare
Choose a tag to compare

Added

  • Illuminate\Contracts\Support\Arrayable interface to JsonApiResponse so it can be used in Inertia responses (as an example).

2.1.0

05 Oct 16:59
74c30b2
Compare
Choose a tag to compare

Added

  • OpenSoutheners\LaravelApiable\Contracts\ViewQueryable and OpenSoutheners\LaravelApiable\Contracts\ViewableBuilder classes for models & custom query builders now functional with JsonApiResponse (can be disabled by config see config/apiable.php)

2.0.1

29 Sep 16:24
1e311bb
Compare
Choose a tag to compare

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

Fixed

  • Getting wrong config keys

2.0.0

29 Sep 15:31
67c22ed
Compare
Choose a tag to compare

⚠️ 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)

1.3.2

21 Sep 10:06
1dd9de9
Compare
Choose a tag to compare

Added

  • JsonApiResponse:forceAppend method to force appends to the final response