mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
38 lines
715 B
PHP
38 lines
715 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use App\Models\Interaction;
|
|
use App\Models\User;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class SongLikeToggled extends Event
|
|
{
|
|
use SerializesModels;
|
|
|
|
/**
|
|
* The interaction (like/unlike) in action.
|
|
*
|
|
* @var Interaction
|
|
*/
|
|
public $interaction;
|
|
|
|
/**
|
|
* The user who carries the action.
|
|
*
|
|
* @var User
|
|
*/
|
|
public $user;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param Interaction $interaction
|
|
* @param User $user
|
|
*/
|
|
public function __construct(Interaction $interaction, User $user = null)
|
|
{
|
|
$this->interaction = $interaction;
|
|
$this->user = $user ?: auth()->user();
|
|
}
|
|
}
|