0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

laravel uuidの生成(uuid version4のみ)

Posted at

概要

  • laravelにてuuidを生成する方法をまとめる

方法

Str::uuid()を用いる

  • 下記のように記載することでuuidを生成することができる。

    use Illuminate\Support\Str;
    
    $uuid = Str::uuid();
    
  • ただ本方法だとuuid version4のみ使用可能である。

  • 別バージョンのuuidを生成したい場合は下記の方法を取る必要がある以下も知れない。

参考文献

Cursor_と_Helpers_-Laravel-_The_PHP_Framework_For_Web_Artisans.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?