Last active
June 29, 2020 21:20
-
-
Save mkwsra/97105e1e560c6a2e7ba6c9e9c475e094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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