66 lines
1.1 KiB
PHP
66 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
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
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Comment extends Model
|
|
{
|
|
protected $table = 'comments';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'tour_id' => 'int',
|
|
'flight_id' => 'int',
|
|
'rating' => 'int',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'tour_id',
|
|
'flight_id',
|
|
'rating',
|
|
'comment',
|
|
'status'
|
|
];
|
|
|
|
public function tour()
|
|
{
|
|
return $this->belongsTo(Tour::class, 'tour_id');
|
|
}
|
|
|
|
public function flight()
|
|
{
|
|
return $this->belongsTo(Flight::class, 'flight_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}}
|