Changeset View
Changeset View
Standalone View
Standalone View
src/app/SignupInvitation.php
Show All 25 Lines | class SignupInvitation extends Model | ||||
// it's been sent successfully | // it's been sent successfully | ||||
public const STATUS_SENT = 1 << 1; | public const STATUS_SENT = 1 << 1; | ||||
// sending failed | // sending failed | ||||
public const STATUS_FAILED = 1 << 2; | public const STATUS_FAILED = 1 << 2; | ||||
// the user signed up | // the user signed up | ||||
public const STATUS_COMPLETED = 1 << 3; | public const STATUS_COMPLETED = 1 << 3; | ||||
/** | /** @var array<int, string> The attributes that are mass assignable */ | ||||
* The attributes that are mass assignable. | |||||
* | |||||
* @var array | |||||
*/ | |||||
protected $fillable = ['email']; | protected $fillable = ['email']; | ||||
/** | /** | ||||
* Returns whether this invitation process completed (user signed up) | * Returns whether this invitation process completed (user signed up) | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isCompleted(): bool | public function isCompleted(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_COMPLETED) > 0; | return ($this->status & self::STATUS_COMPLETED) > 0; | ||||
Show All 31 Lines | class SignupInvitation extends Model | ||||
/** | /** | ||||
* The account to which the invitation was used for. | * The account to which the invitation was used for. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function user() | public function user() | ||||
{ | { | ||||
return $this->belongsTo('App\User', 'user_id', 'id'); | return $this->belongsTo(User::class, 'user_id', 'id'); | ||||
} | } | ||||
} | } |