mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-06 20:55:04 +02:00
* refactor(api): prefer composition to strict inheritance for API queries, requests & actions * style: fix StyleCI findigns
31 lines
570 B
PHP
31 lines
570 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Contracts\Http\Api\Field;
|
|
|
|
use App\Http\Api\Query\Query;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Interface RenderableField.
|
|
*/
|
|
interface RenderableField
|
|
{
|
|
/**
|
|
* Determine if the field should be displayed to the user.
|
|
*
|
|
* @param Query $query
|
|
* @return bool
|
|
*/
|
|
public function shouldRender(Query $query): bool;
|
|
|
|
/**
|
|
* Get the value to display to the user.
|
|
*
|
|
* @param Model $model
|
|
* @return mixed
|
|
*/
|
|
public function render(Model $model): mixed;
|
|
}
|