Shell B4ckd00r
Current Dir :
/
home
/
u789730693
/
domains
/
piorasplash.com
/
public_html
/
app
/
Models
/
Home
Upload
Create Dir
Create File
Curl
Current File : /home/u789730693/domains/piorasplash.com/public_html/app/Models/PromotionProduct.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class PromotionProduct extends Model { use HasFactory; protected $table = "promotion_products"; protected $fillable = ['promotion_id', 'product_id']; protected $casts = [ 'id' => 'integer', 'promotion_id' => 'integer', 'product_id' => 'integer', ]; public function promotion(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Promotion::class, 'promotion_id', 'id'); } public function product(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Product::class, 'product_id', 'id')->withTrashed(); } public function products() { return $this->belongsToMany(Product::class, 'promotion_products', 'promotion_id', 'product_id'); } }
v.01