Skip to content

Commit

Permalink
feat: added default sort and tags for report resource
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Apr 24, 2024
1 parent df4a61d commit 9c3e22b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Filament/Dashboard/Resources/ReportResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Illuminate\Http\Request;
use Filament\Forms\Get;
use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager;
use Filament\Forms\Components\SpatieTagsInput;

class ReportResource extends Resource
{
Expand Down Expand Up @@ -131,6 +132,9 @@ public static function form(Form $form): Form
return true;
}
}),
SpatieTagsInput::make('tags')
->splitKeys(['Tab', ','])
->type('reports'),
Select::make('status')
->options([
'pending' => 'Pending',
Expand Down Expand Up @@ -173,6 +177,7 @@ public static function table(Table $table): Table
}),
TextColumn::make('comment')->wrap(),
])
->defaultSort('created_at', 'desc')
->filters([
//
])
Expand Down
2 changes: 2 additions & 0 deletions app/Models/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use OwenIt\Auditing\Contracts\Auditable;
use Spatie\Tags\HasTags;

class Report extends Model implements Auditable
{
use HasFactory;
use \OwenIt\Auditing\Auditable;
use HasTags;

/**
* The attributes that are mass assignable.
Expand Down

0 comments on commit 9c3e22b

Please sign in to comment.