Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mkwsra/97105e1e560c6a2e7ba6c9e9c475e094 to your computer and use it in GitHub Desktop.
Save mkwsra/97105e1e560c6a2e7ba6c9e9c475e094 to your computer and use it in GitHub Desktop.
<?php
namespace App\Models;
class Post extends Model implements HasMedia, ShouldHaveTypes
{
// ...
// Add/override the boot function
protected static function boot()
{
parent::boot();
static::creating(function ($query) {
$query->uuid = \App\Http\Controllers\Controller::uuid();
});
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment