Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117749410
PlanPackageObserver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
594 B
Referenced Files
None
Subscribers
None
PlanPackageObserver.php
View Options
<?php
namespace
App\Observers
;
use
App\PlanPackage
;
class
PlanPackageObserver
{
/**
* Handle the "creating" event on an PlanPackage relation.
*
* Ensures that the entries belong to the same tenant.
*
* @param PlanPackage $planPackage The plan-package relation
*/
public
function
creating
(
PlanPackage
$planPackage
)
{
$package
=
$planPackage
->
package
;
$plan
=
$planPackage
->
plan
;
if
(
$package
->
tenant_id
!=
$plan
->
tenant_id
)
{
throw
new
\Exception
(
"Package and Plan owned by different tenants"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 4, 1:35 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18820278
Default Alt Text
PlanPackageObserver.php (594 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline