@@ -120,6 +120,9 @@ class PlanController extends Controller
public function destroy(string $id)
{
$plan = Plan::findOrFail($id);
+ if(!empty($plan->children()->first())){
+ throw new \Exception("Please remove the sub-level plan.");
+ }
$plan->delete();