forked from eatvio/eatvio-infra
added type to listeners
This commit is contained in:
@@ -10,7 +10,10 @@ class LikeCount extends Component
|
||||
{
|
||||
public Diet $diet;
|
||||
|
||||
protected $listeners = ['liked' => '$refresh'];
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['liked' => '$refresh'];
|
||||
}
|
||||
|
||||
public function mount(Diet $diet): void
|
||||
{
|
||||
|
||||
@@ -12,7 +12,10 @@ class Show extends Component
|
||||
|
||||
public array $tabpanelState = ['positive' => 'positive', 'negative' => false];
|
||||
|
||||
protected $listeners = ['commentAdded' => '$refresh'];
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['commentAdded' => '$refresh'];
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
|
||||
@@ -10,7 +10,10 @@ class LikeCount extends Component
|
||||
{
|
||||
public Plan $plan;
|
||||
|
||||
protected $listeners = ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
|
||||
}
|
||||
|
||||
public function mount(Plan $plan): void
|
||||
{
|
||||
|
||||
@@ -12,13 +12,18 @@ class Show extends Component
|
||||
|
||||
public array $tabpanelState = ['positive' => 'positive', 'negative' => false];
|
||||
|
||||
protected $listeners = ['commentAdded' => '$refresh'];
|
||||
// protected $listeners = ['commentAdded' => '$refresh'];
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.recipe.comment.show');
|
||||
}
|
||||
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['commentAdded' => '$refresh'];
|
||||
}
|
||||
|
||||
public function toggleTabpanelState(string $tabpanelName): void
|
||||
{
|
||||
collect($this->tabpanelState)->keys()->each(
|
||||
|
||||
@@ -11,12 +11,15 @@ use Livewire\WithFileUploads;
|
||||
use Illuminate\Database\Eloquent\Casts\AsCollection;
|
||||
use Illuminate\View\View;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||
|
||||
class Create extends Component
|
||||
{
|
||||
use WithFileUploads;
|
||||
|
||||
public $image;
|
||||
// public UploadedFile $image;
|
||||
public $image;
|
||||
|
||||
public string $state = 'active';
|
||||
|
||||
@@ -48,7 +51,10 @@ class Create extends Component
|
||||
|
||||
public array $state_row = ['ingredient' => 'true', 'article' => 'false'];
|
||||
|
||||
protected $listeners = ['stepRemoved' => '$refresh'];
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['stepRemoved' => '$refresh'];
|
||||
}
|
||||
|
||||
public function toggleStateRow(string $currentRow): void
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class Edit extends Component
|
||||
|
||||
public Recipe $recipe;
|
||||
|
||||
public $image;
|
||||
public string $image;
|
||||
|
||||
public string $state = 'active';
|
||||
|
||||
@@ -48,7 +48,12 @@ class Edit extends Component
|
||||
|
||||
public array $state_row = ['ingredient' => 'true', 'article' => 'false'];
|
||||
|
||||
protected $listeners = ['stepRemoved' => '$refresh', 'parentComponentTagAdded', 'parentComponentTagRemoved'];
|
||||
// protected $listeners = ['stepRemoved' => '$refresh', 'parentComponentTagAdded', 'parentComponentTagRemoved'];
|
||||
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['stepRemoved' => '$refresh', 'parentComponentTagAdded', 'parentComponentTagRemoved'];
|
||||
}
|
||||
|
||||
public function mount(Recipe $recipe): void
|
||||
{
|
||||
@@ -110,6 +115,7 @@ class Edit extends Component
|
||||
);
|
||||
|
||||
$this->steps = array_values($newSteps);
|
||||
|
||||
$this->dispatch('stepRemoved')->self();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,10 @@ class LikeCount extends Component
|
||||
{
|
||||
public Recipe $recipe;
|
||||
|
||||
protected $listeners = ['liked' => '$refresh'];
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['liked' => '$refresh'];
|
||||
}
|
||||
|
||||
public function mount(Recipe $recipe): void
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ class CreateTest extends TestCase
|
||||
|
||||
$lastCreatedPlan = Plan::orderBy('id', 'desc')->first();
|
||||
|
||||
$newPlanUrl = route('plan.show', $lastCreatedPlan, false);
|
||||
$newPlanUrl = route('plan.show', $lastCreatedPlan);
|
||||
|
||||
$testCase->assertRedirect($newPlanUrl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user