refactor: update WarehouseResource to use 'name' as record title and remove unused fields from the warehouse migration

This commit is contained in:
Yoga Pangestu 2026-03-07 00:31:37 +07:00
parent 8ddbe5ed29
commit 15de085f58
3 changed files with 29 additions and 26 deletions

View File

@ -13,7 +13,6 @@
use App\Models\Warehouse;
use BackedEnum;
use Filament\Actions\BulkActionGroup;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
@ -38,7 +37,7 @@ class WarehouseResource extends Resource
protected static ?int $navigationSort = 2;
protected static ?string $recordTitleAttribute = 'notes';
protected static ?string $recordTitleAttribute = 'name';
protected static ?string $slug = 'master/warehouses';
@ -52,18 +51,6 @@ public static function form(Schema $schema): Schema
->autocomplete(false)
->required()
->maxLength(30),
TextInput::make('location')
->label('Lokasi')
->placeholder('Tasikmalaya')
->autocomplete(false)
->nullable(),
Textarea::make('notes')
->label('Catatan')
->placeholder('...')
->nullable()
->autocomplete(false),
])
->columns(1);
}
@ -77,16 +64,6 @@ public static function table(Table $table): Table
->searchable()
->sortable(),
TextColumn::make('location')
->label('Lokasi')
->searchable()
->sortable(),
TextColumn::make('notes')
->label('Catatan')
->searchable()
->limit(50),
...TimestampColumns::make(),
])
->filters([

View File

@ -11,8 +11,6 @@ public function up(): void
Schema::create('warehouses', function (Blueprint $table) {
$table->id();
$table->string('name', 30);
$table->string('location')->nullable();
$table->text('notes')->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
$table->softDeletes();

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('egg_collections', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('egg_collections', function (Blueprint $table) {
//
});
}
};