including "*" doesn't fail, yet also doesn't include relations
ldiebold opened this issue · comments
Luke Diebold commented
We're trying to do some quick prototyping and want to whitelist all relationships.
A request for data works with the following, however the relationship is not loaded:
<?php
namespace App\Http\Controllers\Api;
use App\Models\Tank;
use Orion\Http\Controllers\Controller;
class TankController extends Controller
{
protected $model = Tank::class;
public function includes(): array
{
return ['*'];
}
}
Request looks like this:
http://localhost/api/tanks?include=org
And if I do the following, everything works as expected (org is loaded in the response):
<?php
namespace App\Http\Controllers\Api;
use App\Models\Tank;
use Orion\Http\Controllers\Controller;
class TankController extends Controller
{
protected $model = Tank::class;
public function includes(): array
{
return ['org'];
}
}
Let me know if you need any more information, or a reproduction!
Aleksei Zarubin commented
Hi @ldiebold,
Thank you for reporting the issue - I will look into it.
Aleksei Zarubin commented
Fixed in v2.17.4