Files
hatame.andarza09/app/Models/Comment.php
T

58 lines
876 B
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 $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';
protected $casts = [
'user_id' => 'int',
'tour_id' => 'int',
'rating' => 'int',
'status' => 'int'
];
protected $fillable = [
'user_id',
'tour_id',
'rating',
'comment',
'status'
];
public function tour()
{
return $this->belongsTo(Tour::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
}