Merge pull request 'Added default value as '-' to material_type on view report' (#230) from ranjith-dev into master
Reviewed-on: poc/pds#230
This commit is contained in:
@@ -579,17 +579,18 @@ class StickerMasterResource extends Resource
|
|||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('material_type')
|
Tables\Columns\TextColumn::make('material_type')
|
||||||
->label('Material Type')
|
->label('Material Type')
|
||||||
|
->default('-')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->formatStateUsing(function ($state) {
|
->formatStateUsing(function ($state) {
|
||||||
if (is_null($state) || $state === '') {
|
if (is_null($state) || $state == '') {
|
||||||
return '';
|
return '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
return match ($state) {
|
return match ($state) {
|
||||||
1 => 'Individual',
|
1 => 'Individual',
|
||||||
2 => 'Bundle',
|
2 => 'Bundle',
|
||||||
3 => 'Quantity',
|
3 => 'Quantity',
|
||||||
default => '',
|
default => '-',
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
|
|||||||
Reference in New Issue
Block a user