Page MenuHomePhorge

PlanPackageObserver.php
No OneTemporary

Authored By
Unknown
Size
626 B
Referenced Files
None
Subscribers
None

PlanPackageObserver.php

<?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

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)

Event Timeline