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); }
/** * @return string */ public function getHashidAttribute() { return Hashids::encode($this->id); }
function encode($value) { return Hashids::encode($value); }
public function url() { return route('bin.snippet', [Hashids::encode($this->bin_id), Hashids::encode($this->id)]); }
/** * Get the value of the model's route key. * * @return mixed */ public function getRouteKey() { return Hashids::encode($this->getKey()); }