laravel-api-handler icon indicating copy to clipboard operation
laravel-api-handler copied to clipboard

order by a child column

Open spectrumworx opened this issue 10 years ago • 4 comments
trafficstars

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 request url

http://localhost/public/api/v1/product/view/0?&_offset=0&_limit=10&_config=meta-total-count,meta-filter-count&_sort=-category.category_name

spectrumworx avatar Sep 09 '15 13:09 spectrumworx

I have the same issue. @spectrumworx do you find a solution?

estebanprimost avatar Oct 21 '15 22:10 estebanprimost

Currently not possible due to the way relationships work in Laravel. Basically the same underlying problem as with issue #10.

marcelgwerder avatar Oct 24 '15 08:10 marcelgwerder

+1

od3n avatar Jan 02 '16 17:01 od3n

+1

freshface avatar Jul 19 '17 20:07 freshface