1 | <?php |
||
8 | class PushSubscription extends Model |
||
9 | { |
||
10 | /** |
||
11 | * The attributes that are mass assignable. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $fillable = [ |
||
16 | 'endpoint', |
||
17 | 'public_key', |
||
18 | 'auth_token', |
||
19 | ]; |
||
20 | |||
21 | 13 | public function __construct(array $attributes = []) |
|
29 | |||
30 | /** |
||
31 | * Get the connection name for the push subscriptions. |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 13 | public function getConnectionName() |
|
40 | |||
41 | /** |
||
42 | * Get the user that owns the subscription. |
||
43 | * |
||
44 | * @return \Illuminate\Contracts\Auth\Authenticatable |
||
45 | */ |
||
46 | 1 | public function user() |
|
50 | |||
51 | /** |
||
52 | * Find a subscription by the given endpint. |
||
53 | * |
||
54 | * @param string $endpoint |
||
55 | * @return static|null |
||
56 | */ |
||
57 | 8 | public static function findByEndpoint($endpoint) |
|
61 | } |
||
62 |