1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Modules\Sellers\Models; |
4
|
|
|
|
5
|
|
|
use App\Modules\Sellers\Database\Factories\SellerFactory; |
6
|
|
|
use App\Modules\Sellers\Notifications\Auth\ResetPassword; |
7
|
|
|
use App\Modules\Sellers\Notifications\Auth\VerifyEmail; |
8
|
|
|
use Illuminate\Contracts\Auth\MustVerifyEmail; |
9
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
10
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable; |
11
|
|
|
use Illuminate\Notifications\Notifiable; |
12
|
|
|
use Laravel\Sanctum\HasApiTokens; |
13
|
|
|
|
14
|
|
|
class Seller extends Authenticatable implements MustVerifyEmail |
15
|
|
|
{ |
16
|
|
|
use HasApiTokens, HasFactory, Notifiable; |
|
|
|
|
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* The attributes that are mass assignable. |
20
|
|
|
* |
21
|
|
|
* @var array<int, string> |
22
|
|
|
*/ |
23
|
|
|
protected $fillable = [ |
24
|
|
|
'name', |
25
|
|
|
'email', |
26
|
|
|
'password', |
27
|
|
|
]; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* The attributes that should be hidden for serialization. |
31
|
|
|
* |
32
|
|
|
* @var array<int, string> |
33
|
|
|
*/ |
34
|
|
|
protected $hidden = [ |
35
|
|
|
'password', |
36
|
|
|
'remember_token', |
37
|
|
|
]; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* The attributes that should be cast. |
41
|
|
|
* |
42
|
|
|
* @var array<string, string> |
43
|
|
|
*/ |
44
|
|
|
protected $casts = [ |
45
|
|
|
'email_verified_at' => 'datetime', |
46
|
|
|
]; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Create a new factory instance for the model. |
50
|
|
|
* |
51
|
|
|
* @return \Illuminate\Database\Eloquent\Factories\Factory<static> |
52
|
|
|
*/ |
53
|
22 |
|
protected static function newFactory() |
54
|
|
|
{ |
55
|
22 |
|
return SellerFactory::new(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Send the password reset notification. |
60
|
|
|
* |
61
|
|
|
* @param string $token |
62
|
|
|
*/ |
63
|
3 |
|
public function sendPasswordResetNotification($token) |
64
|
|
|
{ |
65
|
3 |
|
$this->notify(new ResetPassword($token)); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Send the email verification notification. |
70
|
|
|
*/ |
71
|
2 |
|
public function sendEmailVerificationNotification() |
72
|
|
|
{ |
73
|
2 |
|
$this->notify(new VerifyEmail()); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|