faithgen /
gallery
| 1 | <?php |
||
| 2 | |||
| 3 | namespace FaithGen\Gallery\Events\Album; |
||
| 4 | |||
| 5 | use FaithGen\Gallery\Models\Album; |
||
| 6 | use Illuminate\Broadcasting\InteractsWithSockets; |
||
| 7 | use Illuminate\Broadcasting\PrivateChannel; |
||
| 8 | use Illuminate\Foundation\Events\Dispatchable; |
||
| 9 | use Illuminate\Queue\SerializesModels; |
||
| 10 | |||
| 11 | class Created |
||
| 12 | { |
||
| 13 | use Dispatchable, InteractsWithSockets, SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 14 | /** |
||
| 15 | * @var Album |
||
| 16 | */ |
||
| 17 | private $album; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Create a new event instance. |
||
| 21 | * |
||
| 22 | * @param Album $album |
||
| 23 | */ |
||
| 24 | public function __construct(Album $album) |
||
| 25 | { |
||
| 26 | $this->album = $album; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return Album |
||
| 31 | */ |
||
| 32 | public function getAlbum(): Album |
||
| 33 | { |
||
| 34 | return $this->album; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the channels the event should broadcast on. |
||
| 39 | * |
||
| 40 | * @return \Illuminate\Broadcasting\Channel|array |
||
| 41 | */ |
||
| 42 | public function broadcastOn() |
||
| 43 | { |
||
| 44 | return new PrivateChannel('channel-name'); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |