sarga/packages/Webkul/Customer/src/Models/Wishlist.php

48 lines
954 B
PHP
Executable File

<?php
namespace Webkul\Customer\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Customer\Contracts\Wishlist as WishlistContract;
use Webkul\Product\Models\ProductProxy;
class Wishlist extends Model implements WishlistContract
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'wishlist';
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'additional' => 'array',
];
/**
* The attributes that aren't mass assignable.
*
* @var array
*/
protected $guarded = [
'id',
'created_at',
'updated_at',
];
/**
* The product that belong to the wishlist.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function product()
{
return $this->hasOne(ProductProxy::modelClass(), 'id', 'product_id');
}
}