mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
19 lines
358 B
PHP
19 lines
358 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
class HashidsTicketCodeGenerator implements TicketCodeGenerator
|
|
{
|
|
private $hashids;
|
|
|
|
public function __construct($salt)
|
|
{
|
|
$this->hashids = new \Hashids\Hashids($salt, 6, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
}
|
|
|
|
public function generateFor($ticket)
|
|
{
|
|
return $this->hashids->encode($ticket->id);
|
|
}
|
|
}
|