Skip to content

Commit

Permalink
Remove date field
Browse files Browse the repository at this point in the history
  • Loading branch information
andreia committed Apr 11, 2024
1 parent 01aca0c commit f0a444a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ return new class extends Migration
{
Schema::create('mail_logs', function (Blueprint $table) {
$table->increments('id');
$table->dateTime('date');
$table->string('from')->nullable();
$table->string('to')->nullable();
$table->string('cc')->nullable();
Expand Down
3 changes: 1 addition & 2 deletions resources/lang/en/filament-maillog.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
'table.heading' => 'Mail Logs',

'column.status' => 'Status',
'column.date' => 'Date',
'column.subject' => 'Subject',
'column.to' => 'To',
'column.from' => 'From',
Expand All @@ -23,7 +22,7 @@
'column.body' => 'Body',
'column.headers' => 'Headers',
'column.attachments' => 'Attachments',
'column.data' => 'Log',
'column.data' => 'Data',
'column.created_at' => 'Created At',
'column.updated_at' => 'Updated At',
];
1 change: 0 additions & 1 deletion src/Events/MailLogEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function handleMessageSending(MessageSending $event): void
$message = $event->message;

$mailLog = MailLog::create([
'date' => Carbon::now()->format('Y-m-d H:i:s'),
'from' => $this->formatAddressField($message, 'From'),
'to' => $this->formatAddressField($message, 'To'),
'cc' => $this->formatAddressField($message, 'Cc'),
Expand Down
10 changes: 3 additions & 7 deletions src/Resources/MailLogResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static function infolist(Infolist $infolist): Infolist
->label(trans('filament-maillog::filament-maillog.column.message_id')),
Infolists\Components\TextEntry::make('subject')
->label(trans('filament-maillog::filament-maillog.column.subject')),
Infolists\Components\TextEntry::make('date')
->label(trans('filament-maillog::filament-maillog.column.date'))
Infolists\Components\TextEntry::make('created_at')
->label(trans('filament-maillog::filament-maillog.column.created_at'))
->datetime(),
Infolists\Components\TextEntry::make('to')
->label(trans('filament-maillog::filament-maillog.column.to')),
Expand Down Expand Up @@ -88,7 +88,7 @@ public static function infolist(Infolist $infolist): Infolist
Infolists\Components\TextEntry::make('attachments')
->label(trans('filament-maillog::filament-maillog.column.attachments'))
->columnSpanFull(),
Infolists\Components\Section::make('Log')
Infolists\Components\Section::make('Data')
->label(trans('filament-maillog::filament-maillog.column.data'))
->icon('heroicon-m-list-bullet')
->schema([
Expand All @@ -106,10 +106,6 @@ public static function table(Table $table): Table
Tables\Columns\TextColumn::make('status')
->label(trans('filament-maillog::filament-maillog.column.status'))
->sortable(),
Tables\Columns\TextColumn::make('date')
->label(trans('filament-maillog::filament-maillog.column.date'))
->dateTime()
->sortable(),
Tables\Columns\TextColumn::make('subject')
->label(trans('filament-maillog::filament-maillog.column.subject'))
->limit(25)
Expand Down

0 comments on commit f0a444a

Please sign in to comment.