Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117882432
PlanPackageObserver.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
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 \App\PlanPackage $planPackage The plan-package relation
*
* @return void
*/
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
Mon, Apr 6, 12:33 AM (6 d, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
22/4b/5102f52e8dcd551383db7fa6eb4e
Default Alt Text
PlanPackageObserver.php (626 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline