| 1 | <?php |
||
| 14 | class PushSubscription extends Model |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The attributes that are mass assignable. |
||
| 18 | * |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | protected $fillable = [ |
||
| 22 | 'endpoint', |
||
| 23 | 'public_key', |
||
| 24 | 'auth_token', |
||
| 25 | 'content_encoding', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create a new model instance. |
||
| 30 | * |
||
| 31 | * @param array $attributes |
||
| 32 | * @return void |
||
|
|
|||
| 33 | */ |
||
| 34 | 11 | public function __construct(array $attributes = []) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Get the model related to the subscription. |
||
| 49 | * |
||
| 50 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
| 51 | */ |
||
| 52 | public function subscribable() |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Find a subscription by the given endpint. |
||
| 59 | * |
||
| 60 | * @param string $endpoint |
||
| 61 | * @return static|null |
||
| 62 | */ |
||
| 63 | 9 | public static function findByEndpoint($endpoint) |
|
| 67 | } |
||
| 68 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.