PHP code example of marque / parley

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

    

marque / parley example snippets


use Marque\Parley\Concerns\HasThreads;

class Torrent extends Model
{
    use HasThreads;
}

$torrent->comments($userId);   // the comment thread, created on first use
$torrent->commentCount();
$torrent->hasComments();
$torrent->latestComment();

use Marque\Parley\Contracts\ThreadServiceInterface;

$thread = app(ThreadServiceInterface::class)->threadFor($torrent, auth()->user());

'forum' => [
    'enabled' => env('PARLEY_FORUM', true),
],

'moderation' => [
    'role' => 'moderator',   // the minimum trove role that can moderate
],

'rate_limiting' => [
    'enabled' => env('PARLEY_RATE_LIMITING', false),
    'max_attempts' => env('PARLEY_RATE_LIMIT_MAX', 5),
    'decay_seconds' => env('PARLEY_RATE_LIMIT_DECAY', 60),
],
bash
php artisan vendor:publish --tag=parley-config