laravel-api-handler
laravel-api-handler copied to clipboard
Package providing helper functions for a Laravel REST-API
According to https://laravel.com/docs/5.8/upgrade#eloquent method's names must be changed. This change is only for 5.8 and up without backward compatibility. I suggest separate version/branch.
We should be able to accept -lk params with multiple wild cards, eg `title-lk=*aaa*bbb*` Currently the middle * in the above query would not be changed to a % ....
It would be nice to add ability to make appends on results. For example if user model has getFullNameAttribute() we could use something like: /users?_appends=fullName I make workaround in my...
It would be great to have a flag to allow the API handler to also use soft-deleted entities (deleted_at not null) as Laravel allows it easily with: ``` Model::withTrashed()->get(); ```...
Dynamic relationships are very powerfull but also bit unsecure. Any experience with securing nested resources? For example user is able to get posts `posts?with=author` but .. `posts?with=author.privateSettings` this should be...
/user/dogs?breed.name=labrador is it possible? In this case: dogs->belongsTo('Breed'); In breed, name is an attribute.
Stumbled upon a usercase where I would have to make an comparison on a nullable datetime field ended_at-min OR null. Wonder if there is any way to make that possible?
how to send a request to order by a column form 'with' table here is my backend code ``` $query = Product::query(); $query->company(); $query->with('category'); $result=ApiHandler::parseMultiple($query); return $result->getResponse(); ``` and the...
Api like: ``` http://mba.cn/api/tests/users?_with=class,class.headteacher,nation&nation.id-in=1,2&_fields=class.name,class.headteacher.name ``` cause: ``` "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'headteacher.name' in 'field list' (SQL: select `name`, `headteacher`.`name`, `id`, `headteacher_id` from `mba_classes` where `mba_classes`.`id` in (1))"...