Load Schema / Reuse Schema
Hello All,
Is there any better / official way to load or reuse schema to avoid code duplication?
currently, I am doing it by storing it in a class inside App\Filament\Schema namespace.
<?php
namespace App\Filament\Schema;
use Closure;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Hidden;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Squire\Models\Timezone;
class EventTypeScheduleSchema
{
function getSchema() : array {
return [ //schema ];
}
}
and in actual form method
->createOptionForm($etschema->getSchema())
Could you please help with this?
Thank you.
Is there any better / official way to load or reuse schema to avoid code duplication?
currently, I am doing it by storing it in a class inside App\Filament\Schema namespace.
<?php
namespace App\Filament\Schema;
use Closure;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Hidden;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Squire\Models\Timezone;
class EventTypeScheduleSchema
{
function getSchema() : array {
return [ //schema ];
}
}
and in actual form method
->createOptionForm($etschema->getSchema())
Could you please help with this?
Thank you.