<?php

namespace App\Http\Livewire;

use Livewire\Component;
use Cart;

class Sepeticonu extends Component
{
    protected $listeners = ['refreshComponent' => '$refresh','denemedata' => 'dropdownuAc'];




    public function render()
    {
        $this->dispatchBrowserEvent('denemedata'); // JavaScript kodunu tetikle

        return view('livewire.sepeticonu');

    }

    public function destroy($id){
        Cart::remove($id);
        $this->emitTo('sepeticonu','refreshComponent');
        $this->emitTo('sepet','refreshComponent');


        session()->flash('success','Sepeten Başarıyla Silindi');


    }




}
