mercredi 27 décembre 2017

Laravel updating column with relation

I have model with activation tokens:

class ActivationToken extends Model
{
    public function user() : BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}

in Activation controller i have $token objet. So i can check with user is attached to this token: $token->user; the question is how can I update is_active column in my user table?

$token->user->is_active = true; How can i save it?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2CbclMN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire