Added operator_id column, and searchable filter in view
This commit is contained in:
@@ -376,6 +376,9 @@ class ProductionLineStopResource extends Resource
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('operator_id')
|
||||
->label('Operator ID')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->dateTime()
|
||||
@@ -407,7 +410,6 @@ class ProductionLineStopResource extends Resource
|
||||
}),
|
||||
|
||||
//block
|
||||
|
||||
Select::make('Block')
|
||||
->label('Select Block')
|
||||
->options(fn (callable $get) =>
|
||||
@@ -418,7 +420,6 @@ class ProductionLineStopResource extends Resource
|
||||
->reactive(),
|
||||
|
||||
//shift
|
||||
|
||||
Select::make('Shift')
|
||||
->label('Select Shift')
|
||||
->options(function (callable $get) {
|
||||
@@ -436,7 +437,6 @@ class ProductionLineStopResource extends Resource
|
||||
->reactive(),
|
||||
|
||||
//line
|
||||
|
||||
Select::make('line')
|
||||
->label('Select line')
|
||||
->options(function (callable $get) {
|
||||
|
||||
@@ -514,10 +514,16 @@ class ProductionPlanResource extends Resource
|
||||
->numeric()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('line.name')
|
||||
->sortable(),
|
||||
->sortable()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('shift.name')
|
||||
->sortable(),
|
||||
->sortable()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->sortable()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('operator_id')
|
||||
->label('Operator ID')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Filament\Resources\QualityValidationResource\RelationManagers;
|
||||
use App\Models\QualityValidation;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
@@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\Relationship;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
|
||||
@@ -37,7 +39,7 @@ class QualityValidationResource extends Resource
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
->schema(components: [
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->relationship('plant', 'name')
|
||||
->reactive()
|
||||
@@ -51,6 +53,8 @@ class QualityValidationResource extends Resource
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('production_order')
|
||||
->required(),
|
||||
Forms\Components\Hidden::make('operator_id')
|
||||
->default(Filament::auth()->user()->name),
|
||||
|
||||
Forms\Components\TextInput::make('item_id')
|
||||
->label('Item Code')
|
||||
@@ -1646,6 +1650,18 @@ class QualityValidationResource extends Resource
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// public static function mutateFormDataBeforeCreate(array $data): array
|
||||
// {
|
||||
// $user =Filament::auth()->user();
|
||||
// dd($user);
|
||||
// if($user){
|
||||
// $data['operator_id'] = $user->name;
|
||||
// }
|
||||
// // $data['operator_id'] = Filament::auth()->user()->name;
|
||||
// return $data;
|
||||
// }
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -32,6 +32,7 @@ class QualityValidation extends Model
|
||||
'part_validation3',
|
||||
'part_validation4',
|
||||
'part_validation5',
|
||||
'operator_id',
|
||||
];
|
||||
|
||||
public function stickerMaster(): BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user