?
<?php
namespace App\Livewire;
use Livewire\Component;
use App\Models\Attributesvalue;
class Attributevalue extends Component
{
public $listingid ;
public $displaystats ;
public $avid ;
protected $listeners = ['refreshComponent' => '$refresh']; /*Note: activating the refresh*/
public function mount($listingid){
return $this->displaystats = Attributesvalue::GetAttribDetails($listingid);
}
// public function booted($avid)
// {
// dd('hello2');
// return $this->dropData = Attributesvalue::find($avid)->delete();
// }
public function dropData ($avid){
if(!empty($avid)){
$data = Attributesvalue::findOrFail($avid);
$this->dropData = $data->delete();
}
$this->emit('refreshComponent');
}
public function render()
{
return view('livewire.attributevalue');
}
}