migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Customer\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OtpVerification extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $hidden = [
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
}
|
||||
52
public/restaurant/Modules/Customer/app/Models/Review.php
Normal file
52
public/restaurant/Modules/Customer/app/Models/Review.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Customer\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Restaurant\Models\Customer;
|
||||
use Modules\Restaurant\Models\FoodItem;
|
||||
|
||||
class Review extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'customer_id',
|
||||
'food_item_id',
|
||||
'rating',
|
||||
'comment',
|
||||
'is_approved',
|
||||
'is_active',
|
||||
'likes_count',
|
||||
'reported_count',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_approved' => 'boolean',
|
||||
'is_active' => 'boolean',
|
||||
'rating' => 'integer',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'reviews';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
/* ================= Relationships ================= */
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany(ReviewImage::class)->select('id', 'review_id', 'image_path', 'position');
|
||||
}
|
||||
|
||||
public function foodItem()
|
||||
{
|
||||
return $this->belongsTo(FoodItem::class)->select('id', 'name', 'image');
|
||||
}
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Customer\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ReviewImage extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'review_id',
|
||||
'image_path',
|
||||
'position',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'position' => 'integer',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'review_images';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function review()
|
||||
{
|
||||
return $this->belongsTo(Review::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user