-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPassport.php
67 lines (61 loc) · 1.9 KB
/
Passport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace App\Models;
use Database\Factories\PassportFactory;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
/**
* App\Models\Passport
*
* @property int $id
* @property string|null $nationality
* @property string|null $passport_number
* @property Carbon|null $issue_date
* @property Carbon|null $expiration_date
* @property int|null $user_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property-read User|null $user
*
* @method static PassportFactory factory(...$parameters)
* @method static Builder|Passport newModelQuery()
* @method static Builder|Passport newQuery()
* @method static Builder|Passport query()
* @method static Builder|Passport whereCreatedAt($value)
* @method static Builder|Passport whereExpirationDate($value)
* @method static Builder|Passport whereId($value)
* @method static Builder|Passport whereIssueDate($value)
* @method static Builder|Passport whereNationality($value)
* @method static Builder|Passport wherePassportNumber($value)
* @method static Builder|Passport whereUpdatedAt($value)
* @method static Builder|Passport whereUserId($value)
*
* @mixin Eloquent
*/
class Passport extends Model
{
use HasCompletenessCheck;
use HasFactory;
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'issue_date' => 'date:Y-m-d',
'expiration_date' => 'date:Y-m-d',
'passport_number' => 'string',
'nationality' => 'string',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function isComplete(): bool
{
return $this->isCompleteCheck(Passport::factory()->definition());
}
}