Skip to content

Commit

Permalink
Merge branch '1.x' into fix/list-screen-pagination-all-option
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Jan 24, 2025
2 parents e66c3bf + cfa3db1 commit c2014cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use Lunar\Admin\Support\RelationManagers\BaseRelationManager;
use Lunar\Facades\ModelManifest;
use Lunar\Models\Product;

class ProductConditionRelationManager extends BaseRelationManager
Expand Down Expand Up @@ -38,7 +39,9 @@ public function getDefaultTable(Table $table): Table
->paginated(false)
->modifyQueryUsing(
fn ($query) => $query->whereIn('type', ['condition'])
->wherePurchasableType(Product::class)
->wherePurchasableType(
ModelManifest::getMorphMapKey(Product::class)
)
->whereHas('purchasable')
)
->headerActions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use Lunar\Admin\Support\RelationManagers\BaseRelationManager;
use Lunar\Facades\ModelManifest;
use Lunar\Models\Product;

class ProductRewardRelationManager extends BaseRelationManager
Expand Down Expand Up @@ -38,7 +39,9 @@ public function getDefaultTable(Table $table): Table
->paginated(false)
->modifyQueryUsing(
fn ($query) => $query->whereIn('type', ['reward'])
->wherePurchasableType(Product::class)
->wherePurchasableType(
ModelManifest::getMorphMapKey(Product::class)
)
->whereHas('purchasable')
)
->headerActions([
Expand Down

0 comments on commit c2014cc

Please sign in to comment.