File: /var/www/ipsremont-demo/app/Models/ShipmentDpdChanges.php
<?php
namespace App\Models;
use App\Traits\My;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* @property int $id
* @property string $dpd_order_nr
* @property string $dpd_parcel_nr
* @property string $pickup_date
* @property string $plan_delivery_date
* @property string $new_state
* @property string $transition_time
* @property string $terminal_code
* @property string $terminal_city
* @property ?string $created_at
* @property ?string $updated_at
* @property ?string $deleted_at
* @property int $shipment_id
*/
class ShipmentDpdChanges extends BaseModel
{
use SoftDeletes, My;
public function _save($status, $shipment_id)
{
$this->dpd_order_nr = $status->dpdOrderNr;
$this->dpd_parcel_nr = $status->dpdParcelNr;
$this->pickup_date = $status->pickupDate;
$this->plan_delivery_date = $status->planDeliveryDate;
$this->new_state = $status->newState;
$this->transition_time = $status->transitionTime;
$this->terminal_code = $status->terminalCode;
$this->terminal_city = $status->terminalCity;
$this->shipment_id = $shipment_id;
$this->save();
return $this;
}
protected $casts = [
'transition_time' => 'datetime:Y-m-d',
];
}