generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
142 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\FilamentMails\Resources; | ||
|
||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Filament\Infolists\Infolist; | ||
use Filament\Resources\Resource; | ||
use Filament\Resources\Pages\Page; | ||
use Vormkracht10\FilamentMails\Resources\MailResource\Pages\ListMails; | ||
use Vormkracht10\FilamentMails\Resources\EventResource\Pages\ListEvents; | ||
use Vormkracht10\Mails\Models\MailEvent; | ||
|
||
class EventResource extends Resource | ||
{ | ||
protected static ?string $model = MailEvent::class; | ||
|
||
protected static ?string $slug = 'events'; | ||
|
||
protected static ?string $recordTitleAttribute = 'subject'; | ||
|
||
protected static bool $isScopedToTenant = false; | ||
|
||
protected static bool $shouldRegisterNavigation = false; | ||
|
||
public static function getNavigationLabel(): string | ||
{ | ||
return __('Events'); | ||
} | ||
|
||
public static function getLabel(): ?string | ||
{ | ||
return __('Events'); | ||
} | ||
|
||
public static function getNavigationIcon(): string | ||
{ | ||
return 'heroicon-o-calendar'; | ||
} | ||
|
||
public static function shouldRegisterNavigation(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function getTitle(): string | ||
{ | ||
return __('Events'); | ||
} | ||
|
||
public static function infolist(Infolist $infolist): Infolist | ||
{ | ||
return $infolist | ||
->schema([]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->defaultSort('created_at', 'desc') | ||
->columns([]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\ViewAction::make() | ||
->slideOver() | ||
->label(__('View')) | ||
->hiddenLabel() | ||
->tooltip(__('View')), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => ListEvents::route('/'), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\FilamentMails\Resources\EventResource\Pages; | ||
|
||
use Filament\Resources\Components\Tab; | ||
use Filament\Resources\Pages\ListRecords; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Vormkracht10\FilamentMails\Models\Mail; | ||
use Vormkracht10\FilamentMails\Resources\EventResource; | ||
use Vormkracht10\FilamentMails\Widgets\BouncerateWidget; | ||
use Vormkracht10\Mails\Models\MailEvent; | ||
|
||
class ListEvents extends ListRecords | ||
{ | ||
protected static string $resource = EventResource::class; | ||
|
||
public function getTitle(): string | ||
{ | ||
return __('Events'); | ||
} | ||
|
||
protected function getActions(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getTabs(): array | ||
{ | ||
return [ | ||
'all' => Tab::make() | ||
->label(__('All')) | ||
->icon('heroicon-o-inbox') | ||
->badge(MailEvent::count()), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters