104 lines
1.9 KiB
PHP
104 lines
1.9 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Events;
|
||
|
|
|
||
|
|
use App\Models\Etiquette;
|
||
|
|
use App\Models\Media;
|
||
|
|
use App\Models\User;
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
|
||
|
|
class MediaChangedLabel extends MediaCreated
|
||
|
|
{
|
||
|
|
use Dispatchable;
|
||
|
|
use SerializesModels;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The user who created the media
|
||
|
|
*
|
||
|
|
* @var \App\Models\User
|
||
|
|
*/
|
||
|
|
private $user;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The media
|
||
|
|
*
|
||
|
|
* @var \App\Models\Media
|
||
|
|
*/
|
||
|
|
private $media;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The oldLabel
|
||
|
|
*
|
||
|
|
* @var \App\Models\Etiquette|null
|
||
|
|
*/
|
||
|
|
private $oldLabel;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The newLabel
|
||
|
|
*
|
||
|
|
* @var \App\Models\Etiquette|null
|
||
|
|
*/
|
||
|
|
private $newLabel;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a new event instance.
|
||
|
|
*
|
||
|
|
* @param \App\Models\User $user
|
||
|
|
* @param \App\Models\Media $media
|
||
|
|
* @param \App\Models\Etiquette|null $oldLabel
|
||
|
|
* @param \App\Models\Etiquette|null $newLabel
|
||
|
|
*/
|
||
|
|
public function __construct(
|
||
|
|
User $user,
|
||
|
|
Media $media,
|
||
|
|
Etiquette $oldLabel,
|
||
|
|
Etiquette $newLabel,
|
||
|
|
) {
|
||
|
|
$this->user = $user;
|
||
|
|
$this->media = $media;
|
||
|
|
$this->oldLabel = $oldLabel;
|
||
|
|
$this->newLabel = $newLabel;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get User who triggered the event
|
||
|
|
*
|
||
|
|
* @return \App\Models\User
|
||
|
|
*/
|
||
|
|
public function getUser(): User
|
||
|
|
{
|
||
|
|
return $this->user;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the media
|
||
|
|
*
|
||
|
|
* @return \App\Models\Media
|
||
|
|
*/
|
||
|
|
public function getMedia(): Media
|
||
|
|
{
|
||
|
|
return $this->media;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the oldLabel
|
||
|
|
*
|
||
|
|
* @return \App\Models\Etiquette|null
|
||
|
|
*/
|
||
|
|
public function getOldLabel(): Etiquette|null
|
||
|
|
{
|
||
|
|
return $this->oldLabel;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the newLabel
|
||
|
|
*
|
||
|
|
* @return \App\Models\Etiquette|null
|
||
|
|
*/
|
||
|
|
public function getNewLabel(): Etiquette|null
|
||
|
|
{
|
||
|
|
return $this->newLabel;
|
||
|
|
}
|
||
|
|
}
|