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.
69 lines
1.4 KiB
69 lines
1.4 KiB
1 year ago
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Carbon\Carbon;
|
||
|
|
||
|
class RequestMaterial extends Model
|
||
|
{
|
||
|
protected $table = 'm_req_material';
|
||
|
|
||
|
const CREATED_AT = 'created_at';
|
||
|
const UPDATED_AT = 'updated_at';
|
||
|
|
||
|
protected $casts = [
|
||
|
'id' => 'integer',
|
||
|
'price' => 'string',
|
||
|
];
|
||
|
|
||
|
protected $fillable = [
|
||
|
'description',
|
||
|
'required_date',
|
||
|
'qty',
|
||
|
'uom',
|
||
|
'qty_received',
|
||
|
'fom_date',
|
||
|
'pr_date',
|
||
|
'po_date',
|
||
|
'received_date',
|
||
|
'delivery_date',
|
||
|
'status',
|
||
|
'proyek_id',
|
||
|
'created_at',
|
||
|
'created_by',
|
||
|
'updated_at',
|
||
|
'updated_by',
|
||
|
'price'
|
||
|
];
|
||
|
|
||
|
public function getRequiredDateAttribute($value)
|
||
|
{
|
||
|
return Carbon::createFromTimestamp(strtotime($value))
|
||
|
->timezone(env('APP_TIMEZONE'))
|
||
|
->toDateTimeString();
|
||
|
}
|
||
|
|
||
|
public function getFomDateAttribute($value)
|
||
|
{
|
||
|
return Carbon::createFromTimestamp(strtotime($value))
|
||
|
->timezone(env('APP_TIMEZONE'))
|
||
|
->toDateTimeString();
|
||
|
}
|
||
|
|
||
|
public function getPrDateAttribute($value)
|
||
|
{
|
||
|
return Carbon::createFromTimestamp(strtotime($value))
|
||
|
->timezone(env('APP_TIMEZONE'))
|
||
|
->toDateTimeString();
|
||
|
}
|
||
|
|
||
|
public function getPoDateAttribute($value)
|
||
|
{
|
||
|
return Carbon::createFromTimestamp(strtotime($value))
|
||
|
->timezone(env('APP_TIMEZONE'))
|
||
|
->toDateTimeString();
|
||
|
}
|
||
|
|
||
|
}
|