<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
visualbuilder / filament-export-scheduler example snippets
protected function schedule(Schedule $schedule)
{
$schedule->command('export:run')->everyMinute();
}
return [
/**
* To customise the Export Schedule Resource put your own resource here
*/
'resources' => [ExportScheduleResource::class],
/**
* The success Notification and Mailable to use
*/
'notification' => ScheduledExportCompleteNotification::class,
'mailable' => ExportReady::class,
/**
* Allow users to choose from Exporters in these directories
*/
'exporter_directories' => [
'App\Filament\Exporters',
],
/**
* Where the exports should be stored local or s3
*/
'file_disk' => 'local',
/**
* Admin Panel Navigation
* See also Plugin options
*/
'navigation' => [
'enabled' => true,
'sort' => 100,
'label' => 'Scheduled Report',
'plural_label' => 'Scheduled Reports',
'icon' => 'heroicon-o-paper-airplane',
'group' => 'Reports',
'cluster' => false,
'position' => \Filament\Pages\SubNavigationPosition::Top
],
/**
* Which authenticatable models should be allowed to receive exports
* Will be used to populate the Owner picker
*/
'user_models' => [
[
'model' => \App\Models\User::class,
'title_attribute' => 'email',
],
],
];
use VisualBuilder\ExportScheduler\ExportSchedulerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->default()
->plugins([
ExportSchedulerPlugin::make(),
trait InteractsWithExportSchedulerFilter
{
protected $filterOptionLabel = 'name';
public function getFilterLabel(): string
{
return $this->filterOptionLabel;
}
/*
* Exclude relations that should
* not be added to the filter
* @return <array>Illuminate\Database\Eloquent\Relations\Relations
*/
public static function excludeFilterableRelations(): array
{
return [];
}
}