Beispiel #1
0
 public function makeName($file)
 {
     $filename = $file->getClientOriginalName();
     $extension = $file->getClientOriginalExtension();
     $filename = str_replace($extension, '', $filename);
     return Hashids::encode(time()) . '-' . str_slug(strtolower($filename)) . '.' . $extension;
 }
 /**
  * Create a new random id.
  *
  * @return string
  */
 protected function generateUnique()
 {
     $seed = $this->makeUniqueSeed();
     return Hashids::encode($seed);
 }
Beispiel #3
0
 /**
  * @return string
  */
 public function getHashidAttribute()
 {
     return Hashids::encode($this->id);
 }
Beispiel #4
0
function encode($value)
{
    return Hashids::encode($value);
}
Beispiel #5
0
 public function url()
 {
     return route('bin.snippet', [Hashids::encode($this->bin_id), Hashids::encode($this->id)]);
 }
Beispiel #6
0
 /**
  * Get the value of the model's route key.
  *
  * @return mixed
  */
 public function getRouteKey()
 {
     return Hashids::encode($this->getKey());
 }