Changeset View
Changeset View
Standalone View
Standalone View
src/app/SignupCode.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use Carbon\Carbon; | use Carbon\Carbon; | ||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
use Illuminate\Database\Eloquent\SoftDeletes; | |||||
/** | /** | ||||
* The eloquent definition of a SignupCode. | * The eloquent definition of a SignupCode. | ||||
* | * | ||||
mollekopf: Shouldn't the documentation include local_part, domain_part even if extracted via observer from… | |||||
* @property string $code | * @property string $code The full code identifier | ||||
* @property array $data | * @property \Carbon\Carbon $created_at The creation timestamp | ||||
* @property \Carbon\Carbon $expires_at | * @property \Carbon\Carbon $deleted_at The deletion timestamp | ||||
* @property string $short_code | * @property string $domain_part Email domain | ||||
* @property string $email Email address | |||||
* @property \Carbon\Carbon $expires_at The code expiration timestamp | |||||
* @property string $first_name Firstname | |||||
* @property string $ip_address IP address the request came from | |||||
* @property string $last_name Lastname | |||||
* @property string $local_part Email local part | |||||
* @property string $plan Plan title | |||||
* @property string $short_code Short validation code | |||||
* @property \Carbon\Carbon $updated_at The update timestamp | |||||
* @property string $voucher Voucher discount code | |||||
*/ | */ | ||||
class SignupCode extends Model | class SignupCode extends Model | ||||
{ | { | ||||
use SoftDeletes; | |||||
public const SHORTCODE_LENGTH = 5; | public const SHORTCODE_LENGTH = 5; | ||||
public const CODE_LENGTH = 32; | public const CODE_LENGTH = 32; | ||||
// Code expires after so many hours | // Code expires after so many hours | ||||
public const CODE_EXP_HOURS = 24; | public const CODE_EXP_HOURS = 24; | ||||
/** | /** | ||||
Show All 13 Lines | class SignupCode extends Model | ||||
/** | /** | ||||
* The "type" of the auto-incrementing ID. | * The "type" of the auto-incrementing ID. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
/** | /** | ||||
* Indicates if the model should be timestamped. | |||||
* | |||||
* @var bool | |||||
*/ | |||||
public $timestamps = false; | |||||
/** | |||||
* The attributes that are mass assignable. | * The attributes that are mass assignable. | ||||
* | * | ||||
* @var array | * @var array | ||||
*/ | */ | ||||
protected $fillable = ['code', 'short_code', 'data', 'expires_at']; | protected $fillable = [ | ||||
'code', | |||||
/** | 'email', | ||||
* The attributes that should be cast to native types. | 'expires_at', | ||||
* | 'first_name', | ||||
* @var array | 'last_name', | ||||
*/ | 'plan', | ||||
protected $casts = ['data' => 'array']; | 'short_code', | ||||
'voucher' | |||||
]; | |||||
/** | /** | ||||
* The attributes that should be mutated to dates. | * The attributes that should be mutated to dates. | ||||
* | * | ||||
* @var array | * @var array | ||||
*/ | */ | ||||
protected $dates = ['expires_at']; | protected $dates = ['expires_at']; | ||||
Show All 23 Lines |
Shouldn't the documentation include local_part, domain_part even if extracted via observer from email?