source: app/Models/Review.php@ dfae77e

Last change on this file since dfae77e was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 21 months ago
  • Initial commit;
  • Property mode set to 100644
File size: 947 bytes
Line 
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7use Illuminate\Database\Eloquent\Relations\BelongsTo;
8
9class Review extends Model
10{
11 use HasFactory;
12
13 protected $table = 'reviews';
14
15 public $timestamps = false;
16
17 /**
18 * The attributes that are mass assignable.
19 *
20 * @var array<int, string>
21 */
22 protected $fillable = [
23 'rating',
24 'content',
25 'organizer_id',
26 'artist_id',
27 ];
28
29 /**
30 * The attributes that should be cast.
31 *
32 * @var array<string, string>
33 */
34 protected $casts = [
35 'created_at' => 'datetime',
36 ];
37
38 public function organizer(): BelongsTo
39 {
40 return $this->belongsTo(Organizer::class, 'organizer_id', 'user_id');
41 }
42
43 public function artist(): BelongsTo
44 {
45 return $this->belongsTo(Artist::class, 'artist_id', 'user_id');
46 }
47}
Note: See TracBrowser for help on using the repository browser.