1
0
forked from poc/pds

After Production Quantity and Overall Validation

This commit is contained in:
dhanabalan
2025-03-30 23:04:29 +05:30
parent e46f290fd1
commit 6e44b690f1
16 changed files with 1726 additions and 407 deletions

View File

@@ -15,6 +15,7 @@ use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Forms\Components\Section;
class CompanyResource extends Resource
{
@@ -24,15 +25,40 @@ class CompanyResource extends Resource
protected static ?string $navigationGroup = 'Master Entries';
protected static ?int $navigationSort = 1;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->required()
//->citext('name')
->unique(ignoreRecord: true)
->columnSpanFull(),
Section::make('')
->schema([
Forms\Components\TextInput::make('name')
->required()
//->citext('name')
->placeholder('Scan the valid name')
->unique(ignoreRecord: true)
->columnSpanFull()
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$companyId = $get('name');
// Ensure `linestop_id` is not cleared
if (!$companyId) {
$set('cNameError', 'Scan the valid name first.');
return;
}
else
{
$set('cNameError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('cNameError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('cNameError') ? $get('cNameError') : null)
->hintColor('danger'),
])
->columns(2),
]);
}