Added plant select box in not in stock for testing
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Exports\NotInStockExporter;
|
||||
use App\Filament\Imports\NotInStockImporter;
|
||||
use App\Filament\Resources\NotInStockResource\Pages;
|
||||
use App\Models\NotInStock;
|
||||
use App\Models\StickerMaster;
|
||||
@@ -13,6 +15,9 @@ use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
|
||||
|
||||
class NotInStockResource extends Resource
|
||||
{
|
||||
@@ -26,6 +31,11 @@ class NotInStockResource extends Resource
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
->relationship('plant', 'name')
|
||||
->required(),
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
@@ -232,6 +242,22 @@ class NotInStockResource extends Resource
|
||||
Tables\Actions\ForceDeleteBulkAction::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
|
||||
{
|
||||
return parent::getEloquentQuery()
|
||||
|
||||
Reference in New Issue
Block a user