source: app/Models/OfferComment.php@ dfae77e

Last change on this file since dfae77e was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 745 bytes
RevLine 
[dfae77e]1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7use Illuminate\Database\Eloquent\Relations\BelongsTo;
8use Illuminate\Database\Eloquent\Relations\HasOne;
9
10class 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.