Answer the question
In order to leave comments, you need to log in
How to add MustVerifyEmail email verification to a model other than users?
In general, it seemed to me that this is enough:
<?php
namespace App\Models\Butlers;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Nicolaslopezj\Searchable\SearchableTrait;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
class Customer extends Authenticatable implements MustVerifyEmail
{
use SoftDeletes;
use SearchableTrait;
use HasApiTokens, Notifiable;
protected $fillable = ['email', 'password', 'spot_password', 'status', 'first_name', 'last_name', 'phone', 'newsletter', 'sms_verified', 'sms_verification_code','customer_type','company_id'];
protected $hidden = ['password', 'spot_password', 'created_at', 'updated_at', 'deleted_at'];
}
Answer the question
In order to leave comments, you need to log in
The automatic verification mechanism of soap is triggered by the event Illuminate\Auth\Events\Registered
, and the author admitted in the comments that he is trying to trigger it by calling Customer::create()
. Why? Mystery.
If I'm not mistaken this won't help you. You include the same files (MustVerifyEmail for example), where the application logic is already tied strictly.
You will need to override the necessary methods for your idea.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question