Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117750125
DiscountObserver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
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, Apr 4, 2:05 AM (1 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9c/b8/8419f3d1062adec595728965ebe0
Default Alt Text
DiscountObserver.php (626 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline