mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Adds user profile links to the user API resource. Fixes structure of relationship data and link sections. Adds parameter to include related user data when requesting mod data.
23 lines
471 B
PHP
23 lines
471 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V0;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Str;
|
|
|
|
class ApiController extends Controller
|
|
{
|
|
public static function shouldInclude(string $relationship): bool
|
|
{
|
|
$param = request()->get('include');
|
|
|
|
if (! $param) {
|
|
return false;
|
|
}
|
|
|
|
$includeValues = explode(',', Str::lower($param));
|
|
|
|
return in_array(Str::lower($relationship), $includeValues);
|
|
}
|
|
}
|