コード例 #1
0
ファイル: Attachment.php プロジェクト: sidis405/KP
 public function makeName($file)
 {
     $filename = $file->getClientOriginalName();
     $extension = $file->getClientOriginalExtension();
     $filename = str_replace($extension, '', $filename);
     return Hashids::encode(time()) . '-' . str_slug(strtolower($filename)) . '.' . $extension;
 }
コード例 #2
0
 /**
  * Create a new random id.
  *
  * @return string
  */
 protected function generateUnique()
 {
     $seed = $this->makeUniqueSeed();
     return Hashids::encode($seed);
 }
コード例 #3
0
ファイル: Tokenable.php プロジェクト: nanokaweb/async-game
 /**
  * @return string
  */
 public function getHashidAttribute()
 {
     return Hashids::encode($this->id);
 }
コード例 #4
0
ファイル: helpers.php プロジェクト: sibasbo/sibas
function encode($value)
{
    return Hashids::encode($value);
}
コード例 #5
0
ファイル: Snippet.php プロジェクト: bbashy/LaraBin
 public function url()
 {
     return route('bin.snippet', [Hashids::encode($this->bin_id), Hashids::encode($this->id)]);
 }
コード例 #6
0
ファイル: Comment.php プロジェクト: bbashy/LaraBin
 /**
  * Get the value of the model's route key.
  *
  * @return mixed
  */
 public function getRouteKey()
 {
     return Hashids::encode($this->getKey());
 }