68 lines
2 KiB
PHP
68 lines
2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use App\User;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* Class ProductBuying
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $product_id
|
|
* @property int $amount
|
|
* @property string|null $deleted_at
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @property Product $product
|
|
* @property User $user
|
|
* @package App\Models
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying newQuery()
|
|
* @method static \Illuminate\Database\Query\Builder|ProductBuying onlyTrashed()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereAmount($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereDeletedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereProductId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ProductBuying whereUserId($value)
|
|
* @method static \Illuminate\Database\Query\Builder|ProductBuying withTrashed()
|
|
* @method static \Illuminate\Database\Query\Builder|ProductBuying withoutTrashed()
|
|
* @mixin \Eloquent
|
|
*/
|
|
class ProductBuying extends Model
|
|
{
|
|
use SoftDeletes;
|
|
protected $table = 'product_buyings';
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'product_id' => 'int',
|
|
'amount' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'product_id',
|
|
'amount'
|
|
];
|
|
|
|
public function product()
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|