This commit is contained in:
Saeed Vaziry
2024-09-27 20:36:03 +02:00
committed by GitHub
parent b62c40c97d
commit f6bc04763b
122 changed files with 6609 additions and 807 deletions

View File

@ -0,0 +1,72 @@
<?php
namespace App\Web\Fields;
use Filament\Forms\Components\Field;
class AlertField extends Field
{
protected string $view = 'web.fields.alert';
public string $color = 'blue';
public string $icon = 'heroicon-o-information-circle';
public string $message = '';
public function color(string $color): static
{
$this->color = $color;
return $this;
}
public function icon(string $icon): static
{
$this->icon = $icon;
return $this;
}
public function message(string $message): static
{
$this->message = $message;
return $this;
}
public function success(): static
{
return $this->color('green')->icon('heroicon-o-check-circle');
}
public function warning(): static
{
return $this->color('yellow')->icon('heroicon-o-exclamation-circle');
}
public function danger(): static
{
return $this->color('red')->icon('heroicon-o-x-circle');
}
public function info(): static
{
return $this->color('blue')->icon('heroicon-o-information-circle');
}
public function getColor(): string
{
return $this->color;
}
public function getIcon(): string
{
return $this->icon;
}
public function getMessage(): string
{
return $this->message;
}
}