ok
Direktori : /home2/selectio/public_html/innerstore/app/Model/ |
Current File : /home2/selectio/public_html/innerstore/app/Model/Seller.php |
<?php namespace App\Model; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; class Seller extends Authenticatable { use Notifiable; protected $casts = [ 'id' => 'integer', 'orders_count' => 'integer', 'product_count' => 'integer', 'pos+status' => 'integer' ]; public function scopeApproved($query) { return $query->where(['status'=>'approved']); } public function shop() { return $this->hasOne(Shop::class, 'seller_id'); } public function shops() { return $this->hasMany(Shop::class, 'seller_id'); } public function orders() { return $this->hasMany(Order::class, 'seller_id'); } public function product() { return $this->hasMany(Product::class, 'user_id')->where(['added_by'=>'seller']); } public function wallet() { return $this->hasOne(SellerWallet::class); } }