「親登録時に以下のエラーが出てしまいます。」
このコミットが含まれているのは:
コミット
081060c37a
|
@ -59,7 +59,7 @@ class FathersController extends Controller {
|
|||
'email' => $r->email,
|
||||
'token' => $token,
|
||||
'ttl' => date('Y-m-d H:i:s', strtotime("8 hour")),
|
||||
|
||||
'relation_limit' => $result->relation_limit,
|
||||
];
|
||||
|
||||
try {
|
||||
|
@ -169,7 +169,7 @@ class FathersController extends Controller {
|
|||
return ['status_code' => 422, 'error_messages' => $validate->errors()];
|
||||
}
|
||||
|
||||
if ($get = EmailActivation::select('email', 'ttl')->where('token', $r->token)->first()) {
|
||||
if ($get = EmailActivation::select('email', 'ttl', 'relation_limit')->where('token', $r->token)->first()) {
|
||||
if (time() > strtotime($get->ttl)) {
|
||||
// 有効期限が切れている場合
|
||||
return['status_code' => 401, 'error_messages' => ['仮登録の有効期限が切れました。改めて管理者にお問い合わせいただき、再登録を行ってください。']];
|
||||
|
@ -196,6 +196,7 @@ class FathersController extends Controller {
|
|||
'image' => !is_null($r->image) ? '/files/'.$filename : '/assets/default/avatar.jpg',
|
||||
'profile' => $r->profile,
|
||||
'tel' => $r->tel,
|
||||
'relation_limit' => $get->relation_limit,
|
||||
];
|
||||
|
||||
// DBに入ります。
|
||||
|
|
|
@ -8,6 +8,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class EmailActivation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = ['type', 'father_id', 'email', 'token', 'ttl'];
|
||||
protected $fillable = ['type', 'father_id', 'email', 'token', 'ttl', 'relation_limit'];
|
||||
protected $attributes = ['type' => 0];
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ class EmailActivationFactory extends Factory
|
|||
'email' => $this->faker->email,
|
||||
'token' => $this->faker->creditCardNumber,
|
||||
'ttl' => $this->faker->dateTime,
|
||||
'relation_limit' => rand(1,10),
|
||||
'created_at' => $this->faker->dateTime,
|
||||
'updated_at' => $this->faker->dateTime,
|
||||
];
|
||||
|
|
|
@ -20,6 +20,7 @@ class CreateEmailActivationsTable extends Migration
|
|||
$table->string('email', 255)->unique();
|
||||
$table->string('token', 64)->unique();
|
||||
$table->dateTime('ttl');
|
||||
$table->unsignedInteger('relation_limit');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
新しいイシューから参照