Added import and export in vehicle page
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Exports\VehicleEntryExporter;
|
||||||
|
use App\Filament\Imports\VehicleEntryImporter;
|
||||||
use App\Filament\Resources\VehicleEntryResource\Pages;
|
use App\Filament\Resources\VehicleEntryResource\Pages;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
@@ -19,6 +21,8 @@ use Filament\Tables\Filters\Filter;
|
|||||||
use Filament\Forms\Components\DateTimePicker;
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Tables\Actions\ExportAction;
|
||||||
|
use Filament\Tables\Actions\ImportAction;
|
||||||
|
|
||||||
class VehicleEntryResource extends Resource
|
class VehicleEntryResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -280,6 +284,18 @@ class VehicleEntryResource extends Resource
|
|||||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||||
Tables\Actions\RestoreBulkAction::make(),
|
Tables\Actions\RestoreBulkAction::make(),
|
||||||
]),
|
]),
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
ImportAction::make()
|
||||||
|
->importer(VehicleEntryImporter::class)
|
||||||
|
->visible(function() {
|
||||||
|
return Filament::auth()->user()->can('view import vehicle entry');
|
||||||
|
}),
|
||||||
|
ExportAction::make()
|
||||||
|
->exporter(VehicleEntryExporter::class)
|
||||||
|
->visible(function() {
|
||||||
|
return Filament::auth()->user()->can('view export vehicle entry');
|
||||||
|
}),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user