Skip to content

Commit

Permalink
Added Option to Set default layout from Config
Browse files Browse the repository at this point in the history
  • Loading branch information
abbasmashaddy72 committed Mar 12, 2024
1 parent ec87fd4 commit 74347d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/curator.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@
'display_upload_new' => true,
],
'multi_select_key' => 'metaKey',
'table' => [
'layout' => 'list',
]
];
7 changes: 6 additions & 1 deletion src/Resources/MediaResource/ListMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

class ListMedia extends ListRecords
{
public string $layoutView = 'grid';
public string $layoutView;

public function boot()
{
$this->layoutView = config('curator.table.layout') ?? 'grid';
}

protected $listeners = [
'changeLayoutView' => 'changeLayoutView',
Expand Down

0 comments on commit 74347d4

Please sign in to comment.