mail vorlage wip
This commit is contained in:
1 parent
d3dc5178c4
commit
f42a50dc14
15 files changed
+339
-15990
No files matched your search
@@ -19,14 +19,14 @@ class MailAdressenResource extends Resource
|
||||
|
||||
protected static ?string $cluster = NewsletterCluster::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static ?string $navigationLabel = 'Mail Adressen';
|
||||
|
||||
protected static ?string $modelLabel = 'Mail Adressen';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Mail Adressen';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return MailAdressenForm::configure($schema);
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages;
|
||||
|
||||
use App\Filament\Clusters\Newsletter\NewsletterCluster;
|
||||
use App\Filament\Resources\MailVorlages\Pages\ListMailVorlages;
|
||||
use App\Filament\Resources\MailVorlages\Schemas\MailVorlageForm;
|
||||
use App\Filament\Resources\MailVorlages\Tables\MailVorlagesTable;
|
||||
use App\Models\MailVorlage;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class MailVorlageResource extends Resource
|
||||
{
|
||||
protected static ?string $model = MailVorlage::class;
|
||||
|
||||
protected static ?string $cluster = NewsletterCluster::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static ?string $navigationLabel = 'Mail Vorlagen';
|
||||
|
||||
protected static ?string $modelLabel = 'Mail Vorlagen';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Mail Vorlagen';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return MailVorlageForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return MailVorlagesTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListMailVorlages::route('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Pages;
|
||||
|
||||
use App\Filament\Resources\MailVorlages\MailVorlageResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateMailVorlage extends CreateRecord
|
||||
{
|
||||
protected static string $resource = MailVorlageResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Pages;
|
||||
|
||||
use App\Filament\Resources\MailVorlages\MailVorlageResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditMailVorlage extends EditRecord
|
||||
{
|
||||
protected static string $resource = MailVorlageResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Pages;
|
||||
|
||||
use App\Filament\Resources\MailVorlages\MailVorlageResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListMailVorlages extends ListRecords
|
||||
{
|
||||
protected static string $resource = MailVorlageResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()->createAnother(false),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Schemas;
|
||||
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class MailVorlageForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('titel')->suffix('Nur zur Kennung'),
|
||||
RichEditor::make('inhalt')
|
||||
->toolbarButtons([
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
['undo', 'redo'],
|
||||
]),
|
||||
])->columns(1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\MailVorlages\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class MailVorlagesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('titel'),
|
||||
TextColumn::make('inhalt')->html(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user