php-api-wrapper
php-api-wrapper copied to clipboard
:rainbow: Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)
If I define an Eloquent relationship on an API model am I able to get that relation in the API service? Somewhere in app (ie, controller): ```php // App\Models\User $author...
Resolves #39 Queries can still be performed without explicitly setting an operator: ```php Entity::where('active', true)->get(); ``` Or queries can have an operator specified: ```php Entity::where('created_at', '>', Carbon::now())->get(); ``` Queries can...
This PR updates the return types of `ArrayAccess` and `JsonSerializable` interface methods in order to suppress [deprecation notices](https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.type-compatibility-internal) when using the package with PHP 8.1. Could use the `#[\ReturnTypeWillChange]` attribute...
Some APIs allow you to query their data with comparison operators. It would be nice if this package facilitated this by supporting operators much like Eloquent does: ```php Model::where('created_at', '>',...
I'm not sure how updating is suppose to work. Normally to update a model with Eloquent you would do something like: ```php Customer::where('id', 1)->update([ // ... ]); ``` However, this...
When running `Model::find($id)` in a Laravel environment, and that the Model with the id `$id` doesn't exist, the return value is an empty `Model` instance, as opposed to `null` when...
After updating an existing model in laravel to make use of ApiWrapper, I'm unable to load any belongsTo relationships from the model object that gets created. Trying to access them...
Resolves #32 by creating a belongsTo method that allows you to define a relationship with an Eloquent model
I was wondering if the findOne method in Cristal\ApiWrapper\Api purposely doesn't save to cache like the other find methods do. It does check if the cache key exists so it...
How can I eagerload an ApiRelation on an Eloquent model? Im doing `Offerte::with('klant')->get()` where "Offerte" is an eloquent model which uses "HasApiRelations" "Offerte" has this method: ``` public function klant(){...