Files
ticketbeast/app/Concert.php
2016-11-09 10:34:43 -05:00

27 lines
503 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Concert extends Model
{
protected $guarded = [];
protected $dates = ['date'];
public function getFormattedDateAttribute()
{
return $this->date->format('F j, Y');
}
public function getFormattedStartTimeAttribute()
{
return $this->date->format('g:ia');
}
public function getTicketPriceInDollarsAttribute()
{
return number_format($this->ticket_price / 100, 2);
}
}