mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
init
This commit is contained in:
15
app/Traits/HasCustomPaginationView.php
Normal file
15
app/Traits/HasCustomPaginationView.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Livewire\WithPagination;
|
||||
|
||||
trait HasCustomPaginationView
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public function paginationSimpleView(): string
|
||||
{
|
||||
return 'livewire.partials.pagination';
|
||||
}
|
||||
}
|
13
app/Traits/HasToast.php
Normal file
13
app/Traits/HasToast.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Helpers\Toast;
|
||||
|
||||
trait HasToast
|
||||
{
|
||||
public function toast(): Toast
|
||||
{
|
||||
return new Toast($this);
|
||||
}
|
||||
}
|
20
app/Traits/RefreshComponentOnBroadcast.php
Normal file
20
app/Traits/RefreshComponentOnBroadcast.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
trait RefreshComponentOnBroadcast
|
||||
{
|
||||
public function getListeners(): array
|
||||
{
|
||||
return [
|
||||
'echo-private:app,Broadcast' => 'refreshComponent',
|
||||
'refreshComponent' => '$refresh',
|
||||
'$refresh',
|
||||
];
|
||||
}
|
||||
|
||||
public function refreshComponent(array $data): void
|
||||
{
|
||||
$this->emit('refreshComponent');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user