Issues (25)

app/Events/addUser.php (1 issue)

Severity
1
<?php
2
3
/*
4
  Author: UP805717 (springjben)
5
  
6
  This file is used for Laravel events when a user is added to the site.
7
  This event is fired off when a user creates a username (only in the /pin page)
8
*/
9
10
namespace App\Events;
11
12
use Illuminate\Broadcasting\Channel;
13
use Illuminate\Queue\SerializesModels;
14
use Illuminate\Broadcasting\PrivateChannel;
15
use Illuminate\Broadcasting\PresenceChannel;
16
use Illuminate\Foundation\Events\Dispatchable;
17
use Illuminate\Broadcasting\InteractsWithSockets;
18
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
19
20
class addUser implements ShouldBroadcast
21
{
22
    use Dispatchable, InteractsWithSockets, SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Events\addUser: $id, $class, $connection
Loading history...
23
    public $user;
24
    /**
25
     * Create a new event instance.
26
     *
27
     * @return void
28
     */
29
    public function __construct($username)
30
    {
31
        //Each class will contain the answers and so forth..
32
        $this->user = array(
33
             'name' => $username
34
         );
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
         //This is passing the data onto the addUser channel (using Redis)
45
         return ['addUser'];
46
     }
47
}
48