Attendize/app/Models/OrderItem.php

29 lines
592 B
PHP
Raw Permalink Normal View History

2016-03-05 00:18:10 +00:00
<?php
namespace App\Models;
2016-02-29 15:59:36 +00:00
2016-09-06 20:39:27 +00:00
/*
Attendize.com - Event Management & Ticketing
*/
2016-02-29 15:59:36 +00:00
/**
2016-03-05 00:18:10 +00:00
* Description of OrderItems.
2016-02-29 15:59:36 +00:00
*
* @author Dave
*/
2016-03-05 00:18:10 +00:00
class OrderItem extends MyBaseModel
{
// use \Backpack\CRUD\CrudTrait;
2016-03-14 16:37:38 +00:00
/**
* Indicates if the model should be timestamped.
*
* @var bool $timestamps
*/
2016-03-05 00:18:10 +00:00
public $timestamps = false;
protected $fillable = ['title','order_id','quantity','unit_price','unit_booking_fee'];
2020-03-24 13:51:15 +00:00
public function getUnitTotalAttribute(){
return ($this->unit_price + $this->unit_booking_fee) * $this->quantity;
}
2016-02-29 15:59:36 +00:00
}