PHP code example of bethinkpl / laravel-model-uuid
1. Go to this page and download the library: Download bethinkpl/laravel-model-uuid library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Find a specific post with the default (uuid) column name
$post = Post::whereUuid($uuid)->first();
// Find multiple posts with the default (uuid) column name
$post = Post::whereUuid([$first, $second])->get();
// Find a specific post with a custom column name
$post = Post::whereUuid($uuid, 'custom_column')->first();
// Find multiple posts with a custom column name
$post = Post::whereUuid([$first, $second], 'custom_column')->get();