1. Go to this page and download the library: Download quadcompanies/quadsso library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// in your User model — the local password can never satisfy a check
public function getAuthPassword() { return null; }
namespace App\Sso;
use Illuminate\Database\Eloquent\Model;
use QuadCompanies\QuadSSO\Support\NullUserLifecycleHooks;
class OffboardingHooks extends NullUserLifecycleHooks
{
public function __construct(private BillingClient $billing) {}
public function beforeDelete(Model $user): void
{
if ($this->billing->hasOpenInvoices($user)) {
throw new \RuntimeException('user has open invoices'); // vetoes the request
}
$this->billing->closeAccount($user);
}
public function afterDelete(Model $user): void
{
Log::info('offboarded', ['email' => $user->email]);
}
}