Last change
on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago |
|
-
Property mode
set to
100644
|
File size:
745 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Models;
|
---|
4 |
|
---|
5 | use Illuminate\Database\Eloquent\Factories\HasFactory;
|
---|
6 | use Illuminate\Database\Eloquent\Model;
|
---|
7 | use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
---|
8 | use Illuminate\Database\Eloquent\Relations\HasOne;
|
---|
9 |
|
---|
10 | class OfferComment extends Model
|
---|
11 | {
|
---|
12 | use HasFactory;
|
---|
13 |
|
---|
14 | protected $table = 'offer_comments';
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * The attributes that are mass assignable.
|
---|
18 | *
|
---|
19 | * @var array<int, string>
|
---|
20 | */
|
---|
21 | protected $fillable = [
|
---|
22 | 'content',
|
---|
23 | 'author_id',
|
---|
24 | 'offer_id',
|
---|
25 | ];
|
---|
26 |
|
---|
27 | public function offer(): BelongsTo
|
---|
28 | {
|
---|
29 | return $this->belongsTo(Offer::class);
|
---|
30 | }
|
---|
31 |
|
---|
32 | public function author(): BelongsTo
|
---|
33 | {
|
---|
34 | return $this->belongsTo(User::class, 'author_id', 'id');
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.