You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1023 B
47 lines
1023 B
1 year ago
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use App\Traits\UUID;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
||
|
class Disposal extends Model
|
||
|
{
|
||
|
use HasFactory, SoftDeletes, UUID;
|
||
|
protected $table = 'disposals';
|
||
|
|
||
|
protected $fillable = [
|
||
|
'peti_id',
|
||
|
'customer_id',
|
||
|
'date_disposal',
|
||
|
'warehouse_id',
|
||
|
'description',
|
||
|
'jenis_disposal',
|
||
|
'created_by',
|
||
|
'updated_by',
|
||
|
];
|
||
|
|
||
|
public function peti()
|
||
|
{
|
||
|
return $this->belongsTo(Peti::class, 'peti_id')->select(
|
||
|
'id',
|
||
|
'tipe_peti_id',
|
||
|
'customer_id',
|
||
|
'warehouse_id',
|
||
|
'date_pembuatan',
|
||
|
'kondisipeti_id',
|
||
|
'fix_lot',
|
||
|
'updated_by',
|
||
|
);
|
||
|
}
|
||
|
public function customer()
|
||
|
{
|
||
|
return $this->belongsTo(Customer::class, 'customer_id')->select(
|
||
|
'name',
|
||
|
'code_customer',
|
||
|
);
|
||
|
}
|
||
|
}
|