This commit is contained in:
2024-09-01 18:54:23 +05:00
parent 76d18365a5
commit 061f09eca1
1597 changed files with 109451 additions and 1 deletions

43
nova/src/Fields/Color.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
namespace Laravel\Nova\Fields;
use Laravel\Nova\Http\Requests\NovaRequest;
class Color extends Field
{
use HasSuggestions;
use SupportsDependentFields;
/**
* The field's component.
*
* @var string
*/
public $component = 'color-field';
/**
* The text alignment for the field's text in tables.
*
* @var string
*/
public $textAlign = 'center';
/**
* Prepare the element for JSON serialization.
*
* @return array<string, mixed>
*/
public function jsonSerialize(): array
{
$request = app(NovaRequest::class);
if ($request->isFormRequest()) {
return array_merge(parent::jsonSerialize(), [
'suggestions' => $this->resolveSuggestions($request),
]);
}
return parent::jsonSerialize();
}
}