PHP code example of chanthoeun / filament-custom-forms
1. Go to this page and download the library: Download chanthoeun/filament-custom-forms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chanthoeun / filament-custom-forms example snippets
namespace App\Enums;
use Filament\Support\Contracts\HasLabel;
use Chanthoeun\FilamentCustomForms\Contracts\IsFormOption;
enum Gender: string implements HasLabel, IsFormOption
{
case Male = 'male';
case Female = 'female';
public function getLabel(): ?string
{
return match ($this) {
self::Male => __('Male'),
self::Female => __('Female'),
};
}
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Chanthoeun\FilamentCustomForms\Contracts\IsFormOption;
class Province extends Model implements IsFormOption
{
protected $fillable = ['name'];
}