private_reference_number = str_pad(rand(0, pow(10, 9) - 1), 9, '0', STR_PAD_LEFT); }); } public function order() { return $this->belongsTo('\App\Models\Order'); } public function ticket() { return $this->belongsTo('\App\Models\Ticket'); } public function event() { return $this->belongsTo('\App\Models\Event'); } public function scopeWithoutCancelled($query) { return $query->where('attendees.is_cancelled', '=', 0); } // // public function getReferenceAttribute() { // return $this->order->order_reference // } public function getFullNameAttribute() { return $this->first_name.' '.$this->last_name; } public function getDates() { return ['created_at', 'updated_at', 'arrival_time']; } }