Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- class ProductPosition extends Model
- {
- protected $fillable = ['product_id', 'region_id', 'body'];
- public function city()
- {
- return $this->hasManyThrough('App\City', 'App\Region', 'id', 'id');
- }
- public function region()
- {
- return $this->belongsTo('App\Region');
- }
- public function product()
- {
- return $this->belongsTo('App\Product');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement