芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/yeahea.digitalhubbd.com/app/Models/Wishlist.php
belongsTo(Customer::class); } /** * Get the inventory for the list. */ public function inventory() { return $this->belongsTo(Inventory::class); } /** * Get the product for the list. */ public function product() { return $this->belongsTo(Product::class); } /** * Get the wilshlist of the customer */ public function scopeOfCustomer($query, $customer) { return $query->where('customer_id', $customer); } public function scopeByProduct($query, $product_id) { return $query->where('product_id', $product_id); } /** * Scope a query to only include records from the users shop. * * @return \Illuminate\Database\Eloquent\Builder */ public function scopeMine($query) { if (request()->wantsJson()) { return $query->where('customer_id', \Auth::guard('api')->user()->id); } return $query->where('customer_id', \Auth::guard('customer')->user()->id); } }