Added plant select box in not in stock for testing #489
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Exports\NotInStockExporter;
|
||||||
|
use App\Filament\Imports\NotInStockImporter;
|
||||||
use App\Filament\Resources\NotInStockResource\Pages;
|
use App\Filament\Resources\NotInStockResource\Pages;
|
||||||
use App\Models\NotInStock;
|
use App\Models\NotInStock;
|
||||||
use App\Models\StickerMaster;
|
use App\Models\StickerMaster;
|
||||||
@@ -13,6 +15,9 @@ use Filament\Tables;
|
|||||||
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\Tables\Actions\ExportAction;
|
||||||
|
use Filament\Tables\Actions\ImportAction;
|
||||||
|
|
||||||
|
|
||||||
class NotInStockResource extends Resource
|
class NotInStockResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -26,6 +31,11 @@ class NotInStockResource extends Resource
|
|||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
|
Forms\Components\Select::make('plant_id')
|
||||||
|
->label('Plant')
|
||||||
|
->reactive()
|
||||||
|
->relationship('plant', 'name')
|
||||||
|
->required(),
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -232,6 +242,22 @@ class NotInStockResource extends Resource
|
|||||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||||
Tables\Actions\RestoreBulkAction::make(),
|
Tables\Actions\RestoreBulkAction::make(),
|
||||||
]),
|
]),
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
ImportAction::make()
|
||||||
|
->label('Import Not In Stock')
|
||||||
|
->color('warning')
|
||||||
|
->importer(NotInStockImporter::class)
|
||||||
|
->visible(function () {
|
||||||
|
return Filament::auth()->user()->can('view import not in stock');
|
||||||
|
}),
|
||||||
|
ExportAction::make()
|
||||||
|
->label('Export Not In Stock')
|
||||||
|
->color('warning')
|
||||||
|
->exporter(NotInStockExporter::class)
|
||||||
|
->visible(function () {
|
||||||
|
return Filament::auth()->user()->can('view export not in stock');
|
||||||
|
}),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,6 +278,7 @@ class NotInStockResource extends Resource
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function getEloquentQuery(): Builder
|
public static function getEloquentQuery(): Builder
|
||||||
{
|
{
|
||||||
return parent::getEloquentQuery()
|
return parent::getEloquentQuery()
|
||||||
|
|||||||
Reference in New Issue
Block a user