2024-01-10 11:38:25 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2024-01-10 15:10:21 +04:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
2024-01-10 11:38:25 +04:00
|
|
|
|
|
|
|
class Delivery extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'address',
|
|
|
|
'status',
|
|
|
|
'sending_date',
|
|
|
|
'delivery_date',
|
|
|
|
];
|
2024-01-10 15:10:21 +04:00
|
|
|
|
|
|
|
public function users(): BelongsToMany
|
|
|
|
{
|
|
|
|
return $this->belongsToMany(User::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function warehouse(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Warehouse::class);
|
|
|
|
}
|
2024-01-10 11:38:25 +04:00
|
|
|
}
|