PHP code example of twstec / kit-accounts
1. Go to this page and download the library: Download twstec/kit-accounts 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/ */
twstec / kit-accounts example snippets
use Twstec\Kit\Accounts\Deletion\AccountDeletion;
use Twstec\Kit\Accounts\Deletion\Exceptions\DeletionImpededException;
try {
app(AccountDeletion::class)->deleteUser($pessoa); // ou deleteAccount($conta, $quemPediu)
} catch (DeletionImpededException $recusa) {
// Nada foi apagado; a recusa já está na trilha. $recusa->codes(), $recusa->getMessage().
}
use Twstec\Kit\Accounts\Http\ApiRoutes;
// routes/api.php (o Laravel já põe o prefixo `api` e o grupo `api`)
ApiRoutes::register(prefix: 'v1', middleware: []);