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.
48 lines
1.0 KiB
48 lines
1.0 KiB
<?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; |
|
protected $table = 'disposals'; |
|
|
|
protected $fillable = [ |
|
'mobile_id', |
|
'peti_id', |
|
'customer_id', |
|
'date_disposal', |
|
'warehouse_id', |
|
'description', |
|
'status_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', |
|
)->withTrashed(); |
|
} |
|
|
|
public function customer() |
|
{ |
|
return $this->belongsTo(Customer::class, 'customer_id')->select( |
|
'name', |
|
'code_customer', |
|
)->withTrashed(); |
|
} |
|
}
|
|
|