File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,21 +351,42 @@ returns the processor class you just created.
351351``` php
352352namespace App\Nova\Exports;
353353
354- use Coreproc\NovaDataSync\Export\Jobs\ExportProcessor;
355354use Coreproc\NovaDataSync\Export\Nova\Action\ExportNovaAction;
356355
357- class UserExportAction extends ExportNovaAction
356+ class ProductExportAction extends ExportNovaAction
358357{
359358 protected function processor(ActionFields $fields, Collection $models): ExportProcessor
360359 {
361- return new UserExportProcessor ();
360+ return new ProductExportProcessor ();
362361 }
363362}
364363```
365364
366365If you have additional fields that you want to add to the Export feature, you can define them in the ` fields() ` method
367366and access them through the ` $fields ` property.
368367
368+ ``` php
369+ namespace App\Nova\Exports;
370+
371+ use Coreproc\NovaDataSync\Export\Nova\Action\ExportNovaAction;
372+
373+ class ProductExportAction extends ExportNovaAction
374+ {
375+ protected function processor(ActionFields $fields, Collection $models): ExportProcessor
376+ {
377+ return new ProductExportProcessor($fields->get('start_date'), $fields->get('end_date'));
378+ }
379+
380+ public function fields(NovaRequest $request): array
381+ {
382+ return [
383+ Date::make('Start Date')->required(),
384+ Date::make('End Date')->required(),
385+ ];
386+ }
387+ }
388+ ```
389+
369390Now, you can add the ` ExportNovaAction ` to your Nova Resource:
370391
371392``` php
You can’t perform that action at this time.
0 commit comments