|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Cortex\Testimonials\Models; |
|
6
|
|
|
|
|
7
|
|
|
use Rinvex\Tenants\Traits\Tenantable; |
|
8
|
|
|
use Spatie\Activitylog\Traits\LogsActivity; |
|
9
|
|
|
use Rinvex\Testimonials\Models\Testimonial as BaseTestimonial; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Cortex\Testimonials\Models\Testimonial. |
|
13
|
|
|
* |
|
14
|
|
|
* @property int $id |
|
15
|
|
|
* @property int $subject_id |
|
16
|
|
|
* @property string $subject_type |
|
17
|
|
|
* @property int $attestant_id |
|
18
|
|
|
* @property string $attestant_type |
|
19
|
|
|
* @property bool $is_approved |
|
20
|
|
|
* @property string $body |
|
21
|
|
|
* @property \Carbon\Carbon|null $created_at |
|
22
|
|
|
* @property \Carbon\Carbon|null $updated_at |
|
23
|
|
|
* @property \Carbon\Carbon|null $deleted_at |
|
24
|
|
|
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $attestant |
|
25
|
|
|
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $subject |
|
26
|
|
|
* @property \Illuminate\Database\Eloquent\Collection|\Cortex\Tenants\Models\Tenant[] $tenants |
|
27
|
|
|
* |
|
28
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial approved() |
|
29
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial disapproved() |
|
30
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereAttestantId($value) |
|
31
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereAttestantType($value) |
|
|
|
|
|
|
32
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereBody($value) |
|
33
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereCreatedAt($value) |
|
34
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereDeletedAt($value) |
|
35
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereId($value) |
|
36
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereIsApproved($value) |
|
37
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereSubjectId($value) |
|
38
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Rinvex\Testimonials\Models\Testimonial whereSubjectType($value) |
|
39
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial whereUpdatedAt($value) |
|
40
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withAllTenants($tenants, $group = null) |
|
|
|
|
|
|
41
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withAnyTenants($tenants, $group = null) |
|
|
|
|
|
|
42
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withTenants($tenants, $group = null) |
|
|
|
|
|
|
43
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withoutAnyTenants() |
|
44
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\Cortex\Testimonials\Models\Testimonial withoutTenants($tenants, $group = null) |
|
|
|
|
|
|
45
|
|
|
* @mixin \Eloquent |
|
46
|
|
|
*/ |
|
47
|
|
|
class Testimonial extends BaseTestimonial |
|
48
|
|
|
{ |
|
49
|
|
|
use Tenantable; |
|
50
|
|
|
use LogsActivity; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Indicates whether to log only dirty attributes or all. |
|
54
|
|
|
* |
|
55
|
|
|
* @var bool |
|
56
|
|
|
*/ |
|
57
|
|
|
protected static $logOnlyDirty = true; |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* The attributes that are logged on change. |
|
61
|
|
|
* |
|
62
|
|
|
* @var array |
|
63
|
|
|
*/ |
|
64
|
|
|
protected static $logAttributes = [ |
|
65
|
|
|
'subject_id', |
|
66
|
|
|
'subject_type', |
|
67
|
|
|
'attestant_id', |
|
68
|
|
|
'attestant_type', |
|
69
|
|
|
'is_approved', |
|
70
|
|
|
'body', |
|
71
|
|
|
]; |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* The attributes that are ignored on change. |
|
75
|
|
|
* |
|
76
|
|
|
* @var array |
|
77
|
|
|
*/ |
|
78
|
|
|
protected static $ignoreChangedAttributes = [ |
|
|
|
|
|
|
79
|
|
|
'created_at', |
|
80
|
|
|
'updated_at', |
|
81
|
|
|
'deleted_at', |
|
82
|
|
|
]; |
|
83
|
|
|
} |
|
84
|
|
|
|
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.