PHP code example of janyksteenbeek / laravel-uuidable

1. Go to this page and download the library: Download janyksteenbeek/laravel-uuidable 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/ */

    

janyksteenbeek / laravel-uuidable example snippets




namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Janyk\LaravelUuidable\Uuidable;

class Post extends Model
{
    use Uuidable, HasFactory;
    // ...

    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->uuid('id')->primary();
    // ...