Merge pull request 'feat: Add validation rules for Machine and Work Center names; enhance ProcessOrder table sorting; refactor StickerMasterResource for improved readability and functionality' (#14) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
@@ -12,24 +12,24 @@ use App\Models\StickerMaster;
|
|||||||
use Filament\Actions\Exports\Enums\ExportFormat;
|
use Filament\Actions\Exports\Enums\ExportFormat;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
use Filament\Forms\Components\FileUpload;
|
use Filament\Forms\Components\FileUpload;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
use Filament\Forms\Get;
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ExportAction;
|
use Filament\Tables\Actions\ExportAction;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
|
use Filament\Tables\Filters\Filter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Filament\Forms\Components\Section;
|
|
||||||
use Filament\Forms\Components\Select;
|
|
||||||
use Filament\Notifications\Notification;
|
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Storage;
|
|
||||||
use Str;
|
|
||||||
|
|
||||||
class ItemResource extends Resource
|
class ItemResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -48,125 +48,125 @@ class ItemResource extends Resource
|
|||||||
Section::make('')
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->required()
|
->required()
|
||||||
// ->preload()
|
// ->preload()
|
||||||
// ->nullable(),
|
// ->nullable(),
|
||||||
->reactive()
|
->reactive()
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$userHas = Filament::auth()->user()->plant_id;
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
|
||||||
})
|
|
||||||
->default(function () {
|
|
||||||
return optional(Item::latest()->first())->plant_id;
|
|
||||||
})
|
|
||||||
->disabled(fn (Get $get) => !empty($get('id')))
|
|
||||||
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
// Ensure `linestop_id` is not cleared
|
|
||||||
if (!$plantId) {
|
|
||||||
$set('iPlantError', 'Please select a plant first.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$set('iPlantError', null);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('iPlantError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('iPlantError') ? $get('iPlantError') : null)
|
|
||||||
->hintColor('danger'),
|
|
||||||
Forms\Components\TextInput::make('category')
|
|
||||||
->label('Category')
|
|
||||||
->placeholder('Scan the Category'),
|
|
||||||
Forms\Components\TextInput::make('code')
|
|
||||||
->required()
|
|
||||||
->placeholder('Scan the valid code')
|
|
||||||
->autofocus(true)
|
|
||||||
// ->unique(ignoreRecord: true)
|
|
||||||
->alphaNum()
|
|
||||||
->minLength(6)
|
|
||||||
// ->autocapitalize('characters')
|
|
||||||
->reactive()
|
|
||||||
->disabled(fn (Get $get) => !empty($get('id')))
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$code = $get('code');
|
|
||||||
// Ensure `linestop_id` is not cleared
|
|
||||||
if (!$code) {
|
|
||||||
$set('iCodeError', 'Scan the valid code.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (strlen($code) < 6) {
|
|
||||||
$set('iCodeError', 'Item code must be at least 6 digits.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (!preg_match('/^[a-zA-Z0-9]{6,}$/', $code)) {
|
|
||||||
$set('code',null);
|
|
||||||
$set('iCodeError', 'Item code must contain only alpha-numeric characters.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$set('iCodeError', null);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('iCodeError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('iCodeError') ? $get('iCodeError') : null)
|
|
||||||
->hintColor('danger')
|
|
||||||
->rule(function (callable $get) {
|
|
||||||
return Rule::unique('items', 'code')
|
|
||||||
->where('plant_id', $get('plant_id'))
|
|
||||||
->ignore($get('id')); // Ignore current record during updates
|
|
||||||
}),
|
|
||||||
Forms\Components\TextInput::make('hourly_quantity')
|
|
||||||
->required()
|
|
||||||
->label('Hourly Quantity')
|
|
||||||
->placeholder('Scan the valid quantity')
|
|
||||||
->integer()
|
|
||||||
->default(1)
|
|
||||||
->minValue(1)
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$hourQuan = $get('hourly_quantity');
|
|
||||||
// Ensure `linestop_id` is not cleared
|
|
||||||
if (!$hourQuan) {
|
|
||||||
$set('iHourQuanError', 'Scan the valid hourly quantity.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!preg_match('/^[0-9]{1,}$/', $hourQuan)) {
|
|
||||||
$set('hourly_quantity',null);
|
|
||||||
$set('iHourQuanError', 'Quantity must be integer value.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$set('iHourQuanError', null);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('iHourQuanError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('iHourQuanError') ? $get('iHourQuanError') : null)
|
|
||||||
->hintColor('danger'),
|
|
||||||
Forms\Components\TextInput::make('uom')
|
|
||||||
->required()
|
|
||||||
->label('Unit of Measure')
|
|
||||||
->placeholder('Scan the valid uom'),
|
|
||||||
|
|
||||||
Forms\Components\TextInput::make('description')
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||||
->placeholder('Scan the valid description')
|
})
|
||||||
->required()
|
->default(function () {
|
||||||
->minLength(5)
|
return optional(Item::latest()->first())->plant_id;
|
||||||
->columnSpan(['default' => 1, 'sm' => 1]),
|
})
|
||||||
|
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||||
|
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$plantId = $get('plant_id');
|
||||||
|
// Ensure `linestop_id` is not cleared
|
||||||
|
if (! $plantId) {
|
||||||
|
$set('iPlantError', 'Please select a plant first.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$set('iPlantError', null);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('iPlantError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('iPlantError') ? $get('iPlantError') : null)
|
||||||
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('category')
|
||||||
|
->label('Category')
|
||||||
|
->placeholder('Scan the Category'),
|
||||||
|
Forms\Components\TextInput::make('code')
|
||||||
|
->required()
|
||||||
|
->placeholder('Scan the valid code')
|
||||||
|
->autofocus(true)
|
||||||
|
// ->unique(ignoreRecord: true)
|
||||||
|
->alphaNum()
|
||||||
|
->minLength(6)
|
||||||
|
// ->autocapitalize('characters')
|
||||||
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$code = $get('code');
|
||||||
|
// Ensure `linestop_id` is not cleared
|
||||||
|
if (! $code) {
|
||||||
|
$set('iCodeError', 'Scan the valid code.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
if (strlen($code) < 6) {
|
||||||
|
$set('iCodeError', 'Item code must be at least 6 digits.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! preg_match('/^[a-zA-Z0-9]{6,}$/', $code)) {
|
||||||
|
$set('code', null);
|
||||||
|
$set('iCodeError', 'Item code must contain only alpha-numeric characters.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$set('iCodeError', null);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('iCodeError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('iCodeError') ? $get('iCodeError') : null)
|
||||||
|
->hintColor('danger')
|
||||||
|
->rule(function (callable $get) {
|
||||||
|
return Rule::unique('items', 'code')
|
||||||
|
->where('plant_id', $get('plant_id'))
|
||||||
|
->ignore($get('id')); // Ignore current record during updates
|
||||||
|
}),
|
||||||
|
Forms\Components\TextInput::make('hourly_quantity')
|
||||||
|
->required()
|
||||||
|
->label('Hourly Quantity')
|
||||||
|
->placeholder('Scan the valid quantity')
|
||||||
|
->integer()
|
||||||
|
->default(1)
|
||||||
|
->minValue(1)
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$hourQuan = $get('hourly_quantity');
|
||||||
|
// Ensure `linestop_id` is not cleared
|
||||||
|
if (! $hourQuan) {
|
||||||
|
$set('iHourQuanError', 'Scan the valid hourly quantity.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
if (! preg_match('/^[0-9]{1,}$/', $hourQuan)) {
|
||||||
|
$set('hourly_quantity', null);
|
||||||
|
$set('iHourQuanError', 'Quantity must be integer value.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$set('iHourQuanError', null);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('iHourQuanError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('iHourQuanError') ? $get('iHourQuanError') : null)
|
||||||
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('uom')
|
||||||
|
->required()
|
||||||
|
->label('Unit of Measure')
|
||||||
|
->placeholder('Scan the valid uom'),
|
||||||
|
|
||||||
|
Forms\Components\TextInput::make('description')
|
||||||
|
->placeholder('Scan the valid description')
|
||||||
|
->required()
|
||||||
|
->minLength(5)
|
||||||
|
->columnSpan(['default' => 1, 'sm' => 1]),
|
||||||
// ->columnSpanFull(),
|
// ->columnSpanFull(),
|
||||||
Forms\Components\TextInput::make('id')
|
Forms\Components\TextInput::make('id')
|
||||||
->hidden()
|
->hidden()
|
||||||
->readOnly(),
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(3),
|
->columns(3),
|
||||||
]);
|
]);
|
||||||
@@ -187,6 +187,7 @@ class ItemResource extends Resource
|
|||||||
$paginator = $livewire->getTableRecords();
|
$paginator = $livewire->getTableRecords();
|
||||||
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
|
||||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
}),
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
@@ -236,9 +237,143 @@ class ItemResource extends Resource
|
|||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
])
|
])
|
||||||
|
// ->filters([
|
||||||
|
// Tables\Filters\TrashedFilter::make(),
|
||||||
|
// ])
|
||||||
->filters([
|
->filters([
|
||||||
Tables\Filters\TrashedFilter::make(),
|
Tables\Filters\TrashedFilter::make(),
|
||||||
|
Filter::make('advanced_filters')
|
||||||
|
->label('Advanced Filters')
|
||||||
|
->form([
|
||||||
|
Select::make('Plant')
|
||||||
|
->label('Select Plant')
|
||||||
|
->nullable()
|
||||||
|
->options(function (callable $get) {
|
||||||
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
|
||||||
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||||
|
})
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||||
|
$set('item_id', null);
|
||||||
|
$set('operator_id', null);
|
||||||
|
}),
|
||||||
|
Select::make('code')
|
||||||
|
->label('Search by Item Code')
|
||||||
|
->nullable()
|
||||||
|
// ->options(function (callable $get) {
|
||||||
|
// $plantId = $get('Plant');
|
||||||
|
// return $plantId
|
||||||
|
// ? Item::where('plant_id', $plantId)->pluck('code', 'id')
|
||||||
|
// : Item::pluck('code', 'id');
|
||||||
|
// })
|
||||||
|
->options(function (callable $get) {
|
||||||
|
$plantId = $get('Plant');
|
||||||
|
|
||||||
|
return $plantId
|
||||||
|
? Item::where('plant_id', $plantId)->pluck('code', 'id')
|
||||||
|
: [];
|
||||||
|
})
|
||||||
|
->searchable()
|
||||||
|
->reactive(),
|
||||||
|
TextInput::make('description')
|
||||||
|
->label('Search by Description')
|
||||||
|
->placeholder(placeholder: 'Enter Description'),
|
||||||
|
TextInput::make('category')
|
||||||
|
->label('Search by Category')
|
||||||
|
->placeholder(placeholder: 'Enter Category'),
|
||||||
|
TextInput::make('uom')
|
||||||
|
->label('Search by UOM')
|
||||||
|
->placeholder(placeholder: 'Enter UOM'),
|
||||||
|
DateTimePicker::make(name: 'created_from')
|
||||||
|
->label('Created From')
|
||||||
|
->placeholder(placeholder: 'Select From DateTime')
|
||||||
|
->reactive()
|
||||||
|
->native(false),
|
||||||
|
DateTimePicker::make('created_to')
|
||||||
|
->label('Created To')
|
||||||
|
->placeholder(placeholder: 'Select To DateTime')
|
||||||
|
->reactive()
|
||||||
|
->native(false),
|
||||||
|
])
|
||||||
|
->query(function ($query, array $data) {
|
||||||
|
// Hide all records initially if no filters are applied
|
||||||
|
if (
|
||||||
|
empty($data['Plant']) &&
|
||||||
|
empty($data['item_id']) &&
|
||||||
|
empty($data['description']) &&
|
||||||
|
empty($data['uom']) &&
|
||||||
|
empty($data['category']) &&
|
||||||
|
empty($data['created_from']) &&
|
||||||
|
empty($data['created_to'])
|
||||||
|
) {
|
||||||
|
return $query->whereRaw('1 = 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
|
||||||
|
$query->where('plant_id', $data['Plant']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['item_id'])) {
|
||||||
|
$query->where('item_id', $data['item_id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['description'])) {
|
||||||
|
$query->where('description', '%'.$data['description'].'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['uom'])) {
|
||||||
|
$query->where('uom', 'like', '%'.$data['uom'].'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['category'])) {
|
||||||
|
$query->where('category', '%'.$data['category'].'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_from'])) {
|
||||||
|
$query->where('created_at', '>=', $data['created_from']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_to'])) {
|
||||||
|
$query->where('created_at', '<=', $data['created_to']);
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
->indicateUsing(function (array $data) {
|
||||||
|
$indicators = [];
|
||||||
|
|
||||||
|
if (! empty($data['Plant'])) {
|
||||||
|
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['item_id'])) {
|
||||||
|
$indicators[] = 'Item Code: '.$data['item_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['description'])) {
|
||||||
|
$indicators[] = 'Description: '.$data['description'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['uom'])) {
|
||||||
|
$indicators[] = 'UOM: '.$data['uom'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['category'])) {
|
||||||
|
$indicators[] = 'Category: '.$data['category'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_from'])) {
|
||||||
|
$indicators[] = 'From: '.$data['created_from'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($data['created_to'])) {
|
||||||
|
$indicators[] = 'To: '.$data['created_to'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $indicators;
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
|
->filtersFormMaxHeight('280px')
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
@@ -251,7 +386,6 @@ class ItemResource extends Resource
|
|||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
->headerActions([
|
->headerActions([
|
||||||
|
|
||||||
// Tables\Actions\Action::make('Import Items')
|
// Tables\Actions\Action::make('Import Items')
|
||||||
// ->label('Import Items')
|
// ->label('Import Items')
|
||||||
// ->form([
|
// ->form([
|
||||||
@@ -402,7 +536,6 @@ class ItemResource extends Resource
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// $uniqueCodes = array_unique($materialCodes);
|
// $uniqueCodes = array_unique($materialCodes);
|
||||||
|
|
||||||
// $matchedItems = StickerMaster::with('item')
|
// $matchedItems = StickerMaster::with('item')
|
||||||
@@ -483,23 +616,23 @@ class ItemResource extends Resource
|
|||||||
->label('Import Items')
|
->label('Import Items')
|
||||||
->color('warning')
|
->color('warning')
|
||||||
->importer(ItemImporter::class)
|
->importer(ItemImporter::class)
|
||||||
->visible(function() {
|
->visible(function () {
|
||||||
return Filament::auth()->user()->can('view import item');
|
return Filament::auth()->user()->can('view import item');
|
||||||
}),
|
}),
|
||||||
// ->maxRows(100000),
|
// ->maxRows(100000),
|
||||||
ExportAction::make()
|
ExportAction::make()
|
||||||
// ->columnMapping(true)
|
// ->columnMapping(true)
|
||||||
->label('Export Items')
|
->label('Export Items')
|
||||||
->color('warning')
|
->color('warning')
|
||||||
// ->fileName("Items Report " . date('Y-m-d H:i:s'))
|
// ->fileName("Items Report " . date('Y-m-d H:i:s'))
|
||||||
->exporter(ItemExporter::class)
|
->exporter(ItemExporter::class)
|
||||||
->visible(function() {
|
->visible(function () {
|
||||||
return Filament::auth()->user()->can('view export item');
|
return Filament::auth()->user()->can('view export item');
|
||||||
}),
|
}),
|
||||||
// ->formats([
|
// ->formats([
|
||||||
// ExportFormat::Xlsx,
|
// ExportFormat::Xlsx,
|
||||||
// ExportFormat::Csv,
|
// ExportFormat::Csv,
|
||||||
// ]),
|
// ]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ class MachineResource extends Resource
|
|||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
->label('Name')
|
->label('Name')
|
||||||
|
->minLength(5)
|
||||||
->placeholder('Scan the valid Machine Name')
|
->placeholder('Scan the valid Machine Name')
|
||||||
->required()
|
->required()
|
||||||
->rule(function (callable $get) {
|
->rule(function (callable $get) {
|
||||||
@@ -169,6 +170,7 @@ class MachineResource extends Resource
|
|||||||
}),
|
}),
|
||||||
Forms\Components\TextInput::make('work_center')
|
Forms\Components\TextInput::make('work_center')
|
||||||
->label('Work Center')
|
->label('Work Center')
|
||||||
|
->minLength(6)
|
||||||
->placeholder('Scan the valid Work Center')
|
->placeholder('Scan the valid Work Center')
|
||||||
->required()
|
->required()
|
||||||
->rule(function (callable $get) {
|
->rule(function (callable $get) {
|
||||||
|
|||||||
@@ -370,8 +370,7 @@ class ProcessOrderResource extends Resource
|
|||||||
->label('Created At')
|
->label('Created At')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable(),
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
|
||||||
Tables\Columns\TextColumn::make('created_by')
|
Tables\Columns\TextColumn::make('created_by')
|
||||||
->label('Created By')
|
->label('Created By')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user