generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
7 changed files
with
110 additions
and
10 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
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
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
56 changes: 56 additions & 0 deletions
56
tests/TestResources/ModelWithArchivableTraitAndFalseCustomClassesResource.php
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,56 @@ | ||
<?php | ||
|
||
namespace Okeonline\FilamentArchivable\Tests\TestResources; | ||
|
||
use Filament\Forms\Components\DatePicker; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables\Columns\TextColumn; | ||
use Filament\Tables\Table; | ||
use Okeonline\FilamentArchivable\Tables\Actions\ArchiveAction; | ||
use Okeonline\FilamentArchivable\Tables\Actions\UnArchiveAction; | ||
use Okeonline\FilamentArchivable\Tables\Filters\ArchivedFilter; | ||
use Okeonline\FilamentArchivable\Tests\TestModels\ModelWithArchivableTrait; | ||
use Okeonline\FilamentArchivable\Tests\TestResources\ModelWithArchivableTraitAndCustomClassesResource\Pages\ListPage; | ||
|
||
class ModelWithArchivableTraitAndFalseCustomClassesResource extends Resource | ||
{ | ||
protected static ?string $model = ModelWithArchivableTrait::class; | ||
|
||
public static ?string $modelLabel = 'with-classes'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
TextInput::make('name'), | ||
DatePicker::make('archived_at'), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->archivedRecordClasses(false) | ||
->columns([ | ||
TextColumn::make('name'), | ||
TextColumn::make('archived_at') | ||
->dateTime(), | ||
]) | ||
->filters([ | ||
ArchivedFilter::make(), | ||
]) | ||
->actions([ | ||
ArchiveAction::make(), | ||
UnArchiveAction::make(), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => ListPage::route('/'), | ||
]; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/TestResources/ModelWithArchivableTraitAndFalseCustomClassesResource/Pages/ListPage.php
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,11 @@ | ||
<?php | ||
|
||
namespace Okeonline\FilamentArchivable\Tests\TestResources\ModelWithArchivableTraitAndFalseCustomClassesResource\Pages; | ||
|
||
use Filament\Resources\Pages\ListRecords; | ||
use Okeonline\FilamentArchivable\Tests\TestResources\ModelWithArchivableTraitAndFalseCustomClassesResource; | ||
|
||
class ListPage extends ListRecords | ||
{ | ||
protected static string $resource = ModelWithArchivableTraitAndFalseCustomClassesResource::class; | ||
} |