Skip to content

Commit

Permalink
Merge pull request #10 from RickDBCN/feature/sort
Browse files Browse the repository at this point in the history
feature: add defaultSort config option
  • Loading branch information
RickDBCN authored Aug 16, 2023
2 parents 799e04e + a253d50 commit 029e7dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/filament-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
'resource' => [
'group' => null,
'sort' => null,
'default_sort_column' => 'created_at',
'default_sort_direction' => 'desc',
],

'keep_email_for_days' => 60,
Expand Down
1 change: 1 addition & 0 deletions src/Filament/Resources/EmailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static function form(Form $form): Form
public static function table(Table $table): Table
{
return $table
->defaultSort(config('filament-email.resource.default_sort_column'), config('filament-email.resource.default_sort_direction'))
->actions([
Action::make('resend')
->label(__('Send again'))
Expand Down
5 changes: 3 additions & 2 deletions tests/EmailModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

use Faker\Factory;
use Illuminate\Support\Facades\Mail;
use RickDBCN\FilamentEmail\Filament\Resources\EmailResource\Pages\ListEmails;
use RickDBCN\FilamentEmail\Models\Email;

use function Pest\Laravel\assertDatabaseCount;
use function Pest\Laravel\assertModelExists;
use function Pest\Livewire\livewire;
use function PHPUnit\Framework\assertEquals;
use RickDBCN\FilamentEmail\Filament\Resources\EmailResource\Pages\ListEmails;
use RickDBCN\FilamentEmail\Models\Email;

it('can create an Email model', function () {
$emailModel = Email::factory()->create();
Expand Down

0 comments on commit 029e7dd

Please sign in to comment.