From 9b6940989d10b633d503cd624a9575ff0c371aea Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Tue, 19 Nov 2024 14:28:36 +0100 Subject: [PATCH] Apply and restore sort direction (#382) Signed-off-by: Philipp Daun --- src/Assets/AssetContainer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Assets/AssetContainer.php b/src/Assets/AssetContainer.php index afa01415..70c5515f 100644 --- a/src/Assets/AssetContainer.php +++ b/src/Assets/AssetContainer.php @@ -53,6 +53,8 @@ public function fillFromModel(Model $model) ->sourcePreset($model->settings['source_preset'] ?? null) ->warmPresets($model->settings['warm_presets'] ?? null) ->validationRules($model->settings['validation_rules'] ?? null) + ->sortField($model->settings['sort_by'] ?? null) + ->sortDirection($model->settings['sort_dir'] ?? null) ->model($model); return $this; @@ -81,6 +83,8 @@ public static function makeModelFromContract(AssetContainerContract $source) 'source_preset' => $source->sourcePreset, 'warm_presets' => $source->warmPresets, 'validation_rules' => $source->validationRules(), + 'sort_by' => $source->sortField(), + 'sort_dir' => $source->sortDirection(), ]); // Set initial timestamps.