Skip to content

Commit

Permalink
Update ProductResource.php
Browse files Browse the repository at this point in the history
  • Loading branch information
alkadoHs authored Mar 4, 2024
1 parent 42f0f4a commit 067648a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Filament/Resources/ProductResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function form(Form $form): Form
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn (Builder $query) => auth()->user()->role == 'admin' || auth()->user()->role == 'seller' ? $query->orderBy('created_at', 'desc') : $query->where('branch_id', auth()->user()->branch_id)->orderBy('created_at', 'desc'))
->modifyQueryUsing(fn (Builder $query) => auth()->user()->role == 'admin' || auth()->user()->role == 'superuser' ? $query->orderBy('created_at', 'desc') : $query->where('branch_id', auth()->user()->branch_id)->orderBy('created_at', 'desc'))
->columns([
Tables\Columns\TextColumn::make('mainProduct.name')
->label('Product')
Expand Down

0 comments on commit 067648a

Please sign in to comment.