PHP code example of laravel-persona / core

1. Go to this page and download the library: Download laravel-persona/core 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/ */

    

laravel-persona / core example snippets


use Illuminate\Support\Facades\Schedule;

Schedule::command('persona:clean-orphans')->dailyAt('03:00');

$user->delete();       // hard-deletes: wipes the Persona footprint
$user->forceDelete();  // force-deletes: wipes the Persona footprint

Schedule::command('persona:clean-orphans')->dailyAt('03:00');

use Persona\Traits\HasPersona;

class Customer extends Model
{
    use HasPersona;

    // Retain Persona data even if the Customer record is deleted
    public bool $preservePersonaOnDelete = true;
}
bash
php artisan persona:install
bash
php artisan persona:clean-orphans
bash
php artisan persona:clean-orphans              # 1,000 orphans per batch
php artisan persona:clean-orphans --chunk=2500 # tune the batch size
bash
php artisan persona:clean-orphans --pretend
bash
  php artisan persona:clean-orphans
  # Skipping [Customer] (Preservation enabled)