I need do email verification for comments system. When guest create comment, he can write email, name, and body of comment. When user send comment, I need verify email him. And If he confirms email, then I need to publish comment. How can I do it with standard Laravel Email Verification? I have model Comment
, and I have in tables comments columns: email
, email_verified_at
. Maybe I can implement Trait Email Verification for model Comment
? I don't need to check whether user has verified his email address or not. If yes, then user should be able to post a comment. I need every comment verify email him. 1 comment = 1 verified email (even if it is repeated), how I can do it?
In model comment I tryied implement VerifyEmail:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
class Comment extends Model implements MustVerifyEmail
{
use Notifiable;
// ...
}
But what I need do next? In docs only one middleware: ->middleware('verified')
and this for user model, how I can send notification email activation for comment model and do middleware for comment model?