| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class MafOrder extends Model
- {
- use SoftDeletes;
- protected $fillable = [
- 'order_number',
- 'user_id',
- 'product_id',
- 'quantity',
- 'in_stock',
- ];
- const DEFAULT_SORT_BY = 'created_at';
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
- public function product(): BelongsTo
- {
- return $this->belongsTo(Product::class);
- }
- }
|