PHP code example of fahriztx / model-uuid
1. Go to this page and download the library: Download fahriztx/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.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fahriztx / model-uuid example snippets
public function up(): void
{
Schema::create('your_migration', function (Blueprint $table) {
$table->uuid('id')->primary(); // Primary Key using $table->uuid('your_primary_column')->primary();
...
$table->timestamps();
});
}
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
use HasFactory;
use \Fahriztx\ModelUuid\Uuid; // <-- Insert this line on top of your model
}