Skip to content

Commit

Permalink
Add "Clear log" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
xavicabot committed Nov 9, 2024
1 parent d4e6c45 commit 76eed01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Pages/ViewLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Filament\Infolists\Components\TextEntry;
use Filament\Pages\Page;
use Filament\Tables\Actions\Action;
use Filament\Tables\Actions\ViewAction;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\InteractsWithTable;
Expand Down Expand Up @@ -82,6 +83,12 @@ public static function table(Table $table): Table
->formatStateUsing(fn ($state) => new HtmlString('<p style="white-space: pre-wrap">' . $state . '</p>')),
])
->slideOver(),
])
->headerActions([
Action::make('clear_log')
->label(__('Clear Log'))
->requiresConfirmation()
->action(fn () => file_put_contents(storage_path('logs/laravel.log'), '')),
]);
}
}

0 comments on commit 76eed01

Please sign in to comment.