0, ); $defConfig = array_merge($defConfig, $parameters); $profile = (int)$defConfig['profile']; // You need to specify the profile if (empty($profile)) { throw new \RuntimeException('Invalid profile ID', 404); } if ($profile == 1) { throw new \RuntimeException('You cannot delete the default backup profile', 404); } // Get a profile model $profileModel = new Profiles(); $profileModel->findOrFail($profile); $profileModel->delete(); return true; } }