Skip to content

Commit

Permalink
Changelog:
Browse files Browse the repository at this point in the history
- Added: new method for crud table.
  • Loading branch information
Blair2004 committed Apr 4, 2024
1 parent 00662ab commit a5c4fec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Classes/CrudForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public static function tab( $identifier, $label, $fields )

public static function fields( ...$args )
{
return collect( $args )->toArray();
return collect( $args )->filter()->toArray();
}
}
5 changes: 5 additions & 0 deletions app/Classes/CrudTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public static function attribute( $label, $column )
{
return compact( 'label', 'column' );
}

public static function attributes( ...$attributes )
{
return $attributes;
}
}
4 changes: 2 additions & 2 deletions app/Crud/UserCrud.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public function getColumns(): array
CrudTable::column(
identifier: 'username',
label: __( 'Username' ),
attributes: [
attributes: CrudTable::attributes(
CrudTable::attribute(
column: 'active',
label: __( 'Active' )
Expand All @@ -622,7 +622,7 @@ public function getColumns(): array
column: 'email',
label: __( 'Email' )
)
]
)
),
CrudTable::column(
label: __( 'Wallet' ),
Expand Down

0 comments on commit a5c4fec

Please sign in to comment.