PHP code example of ozankurt / laravel-modules-forum

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

    

ozankurt / laravel-modules-forum example snippets


$thread->markSolution($post);   // dispatches SolutionMarked; idempotent
$post->isSolution();            // true
$thread->unmarkSolution();      // dispatches SolutionUnmarked with the previous post

Thread::query()->solved()->get();
Thread::query()->unsolved()->get();

if (Gate::allows('markSolution', $thread)) {
    $thread->markSolution($post);
}

Thread::query()->search('redis caching')->paginate();

namespace Kurt\Modules\Forum\Badges;

interface BadgeRule
{
    public function badgeSlug(): string;

    /** @return array<int, class-string> */
    public function appliesAfter(): array;

    public function evaluate(Illuminate\Database\Eloquent\Model $user, object $event): bool;
}

'http' => [
    'mode' => env('FORUM_HTTP_MODE', 'headless'),
    'prefix' => 'api/forum',
    'middleware' => ['api'],           // base middleware for every route
    'auth_middleware' => ['auth'],     // appended to write routes
    'rate_limit' => '60,1',            // "maxAttempts,decayMinutes" for the forum-api throttle
],

use Filament\Panel;
use Kurt\Modules\Forum\Filament\ForumPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(ForumPlugin::make());
}
bash
php artisan vendor:publish --tag=forum-config
php artisan vendor:publish --tag=forum-migrations
php artisan migrate