fix: regenerate models and add database
This commit is contained in:
+22
-1
@@ -14,10 +14,16 @@ use Illuminate\Database\Eloquent\Model;
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int|null $flight_id
|
||||
* @property int|null $tour_id
|
||||
* @property string $comment
|
||||
* @property int|null $rating
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property Flight|null $flight
|
||||
* @property Tour|null $tour
|
||||
* @property User $user
|
||||
*
|
||||
* @package App\Models
|
||||
@@ -25,20 +31,35 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Comment extends Model
|
||||
{
|
||||
protected $table = 'comments';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'tour_id' => 'int',
|
||||
'rating' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'flight_id',
|
||||
'tour_id',
|
||||
'comment',
|
||||
'rating',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class);
|
||||
}
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
||||
Reference in New Issue
Block a user