git commit "add comments and fix tour comments display"
This commit is contained in:
+18
-11
@@ -11,16 +11,17 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Comment
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $tour_id
|
||||
* @property int $flight_id
|
||||
* @property int $rating
|
||||
* @property string|null $comment
|
||||
* @property int $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
*
|
||||
* @property Tour $tour
|
||||
* @property User $user
|
||||
*
|
||||
@@ -34,6 +35,7 @@ class Comment extends Model
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'tour_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'rating' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
@@ -41,18 +43,23 @@ class Comment extends Model
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'tour_id',
|
||||
'flight_id',
|
||||
'rating',
|
||||
'comment',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class);
|
||||
}
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class, 'tour_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class, 'flight_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user