Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2270316
DiscountObserver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
626 B
Referenced Files
None
Subscribers
None
DiscountObserver.php
View Options
<?php
namespace
App\Observers
;
use
App\Discount
;
/**
* This is an observer for the Discount model definition.
*/
class
DiscountObserver
{
/**
* Ensure the discount ID is a custom ID (uuid).
*
* @param \App\Discount $discount The discount object
*
* @return void
*/
public
function
creating
(
Discount
$discount
):
void
{
while
(
true
)
{
$allegedly_unique
=
\App\Utils
::
uuidStr
();
if
(!
Discount
::
find
(
$allegedly_unique
))
{
$discount
->{
$discount
->
getKeyName
()}
=
$allegedly_unique
;
break
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 11, 10:33 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
325908
Default Alt Text
DiscountObserver.php (626 B)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment