Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kristi11 committed Nov 19, 2024
1 parent 2f2b3e6 commit 0946bd9
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 73 deletions.
8 changes: 4 additions & 4 deletions app/Filament/Resources/Shield/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ public static function getCheckboxListFormComponent(
->columnSpan(FilamentShieldPlugin::get()->getCheckboxListColumnSpan());
}

public static function canEdit(Model $record): bool
{
return false;
}
// public static function canEdit(Model $record): bool
// {
// return false;
// }

public static function canDelete(Model $record): bool
{
Expand Down
6 changes: 4 additions & 2 deletions app/Livewire/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Actions\Shop\CreateStripeCheckoutSession;
use App\Factories\CartFactory;
use Livewire\Attributes\Computed;
use Livewire\Attributes\On;
use Livewire\Component;

class Cart extends Component
Expand All @@ -17,18 +18,19 @@ public function cart()
}

#[Computed]
#[On('productDeletedFromCart')]
public function items()
{
return $this->cart->items;
}

public function increment($itemId)
{
return $this->cart->items()->find($itemId)?->increment('quantity');
return $this->cart->items->find($itemId)?->increment('quantity');
}
public function decrement($itemId): void
{
$item = $this->cart->items()->find($itemId);
$item = $this->cart->items->find($itemId);
if ($item->quantity > 1){
$item->decrement('quantity');
}
Expand Down
Loading

0 comments on commit 0946bd9

Please sign in to comment.