2015-12-21 13:49:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Events;
|
|
|
|
|
|
|
|
use App\Models\Interaction;
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
class SongLikeToggled extends Event
|
|
|
|
{
|
|
|
|
use SerializesModels;
|
|
|
|
|
2021-06-05 10:47:56 +00:00
|
|
|
public Interaction $interaction;
|
|
|
|
public ?User $user = null;
|
2015-12-21 13:49:00 +00:00
|
|
|
|
2020-12-22 20:11:22 +00:00
|
|
|
public function __construct(Interaction $interaction, ?User $user = null)
|
2015-12-21 13:49:00 +00:00
|
|
|
{
|
|
|
|
$this->interaction = $interaction;
|
2018-09-04 06:25:24 +00:00
|
|
|
$this->user = $user ?: auth()->user();
|
2015-12-21 13:49:00 +00:00
|
|
|
}
|
|
|
|
}
|