mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-23 14:57:46 +01:00
49 lines
989 B
PHP
49 lines
989 B
PHP
<?php
|
|
|
|
namespace App\JsonApi\V1;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\JsonApi\V1\Users\UserSchema;
|
|
use LaravelJsonApi\Core\Server\Server as BaseServer;
|
|
|
|
class Server extends BaseServer
|
|
{
|
|
/**
|
|
* The base URI namespace for this server.
|
|
*/
|
|
protected string $baseUri = '/api/v1';
|
|
|
|
/**
|
|
* Bootstrap the server when it is handling an HTTP request.
|
|
*/
|
|
public function serving(): void
|
|
{
|
|
// no-op
|
|
}
|
|
|
|
/**
|
|
* Get the server's list of schemas.
|
|
*/
|
|
protected function allSchemas(): array
|
|
{
|
|
return app(Controller::class)
|
|
->getModules()
|
|
->pluck('config.api.schemas')
|
|
->reject(null)
|
|
->push(UserSchema::class)
|
|
->flatten()
|
|
->all();
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
* TODO: Temporary: it must be added authentication to API routes
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorizable(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|