PHP code example of laravel-afterburner / documents

1. Go to this page and download the library: Download laravel-afterburner/documents 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-afterburner / documents example snippets


$schedule->command('documents:cleanup-upload-sessions')->hourly();

use Afterburner\Documents\Concerns\HasDocumentLinks;
use Afterburner\Documents\Actions\LinkDocument;
use Afterburner\Documents\Actions\UnlinkDocument;

class Meeting extends Model
{
    use HasDocumentLinks;
}

// Link
app(LinkDocument::class)->execute($document, $meeting, $user);

// Unlink
app(UnlinkDocument::class)->execute($document, $meeting, $user);

// Query linked documents
$meeting->linkedDocuments;
bash
php artisan afterburner:documents:install
bash
php artisan vendor:publish --tag=afterburner-documents-config
php artisan vendor:publish --tag=afterburner-documents-migrations
php artisan vendor:publish --tag=afterburner-documents-assets
php artisan vendor:publish --tag=livewire-filepond-assets
php artisan migrate
php artisan db:seed --class="Afterburner\\Documents\\Database\\Seeders\\DocumentPermissionsSeeder"