PHP code example of leganz / laravel-uuid

1. Go to this page and download the library: Download leganz/laravel-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.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leganz / laravel-uuid example snippets

 php
"emadadly/laravel-uuid": "1.*",
 php
'providers' => [
   ...
   Emadadly\LaravelUuid\LaravelUuidServiceProvider::class,
],
 bash
php artisan vendor:publish --provider="Emadadly\LaravelUuid\LaravelUuidServiceProvider"
 php
$table->uuid('uuid');
 php
Schema::create('users', function (Blueprint $table) {

  $table->increments('id');
  $table->uuid('uuid');
  ....
  ....
  $table->timestamps();
});
 php
public function show($uuid)
{
  $example = ExampleModel::uuid($uuid);
  return response()->json(['example' => $example]);
}