Mon Mar 02 2026
...
ืืืืืช Laravel ืืจืฉืืืช ืฉืืืจืจื
ืื ืืืฉ
ืื ื ื ืจืืฉืื ืืืืจืื ืขื ืฉืืจืืจ ืืืืืื ืืจืฉืืืช ืฉืื ื ื-Laravel, fastcomments/laravel. ืื ืืชื ืืื ื ืขื Laravel ืืจืืฆื ืืืืกืืฃ
ืชืืืืืช, ืฆ'ืื ืื, ืื ืกืคืืจืช ืชืืืืืช ืืืคืืืงืฆืื ืฉืื, ืืชื ืืืื ืืขืช ืืขืฉืืช ืืืช ืขื ืืชืงื ื ืืืช ืฉื Composer ืืืื ืจืืืื Blade.
ืืืืืื ืชืืืืช ื-Laravel 10, 11, ื-12 ืขื PHP 8.1+.
ืืื ืืืชืืื
ืืชืงื ืขื Composer:
composer require fastcomments/laravel
ืืืืจ ืืื ืืืกืฃ ืืช ืืืื ืืฉืืืจ ืฉืื ืืืช ืืคืชื ื-API ืฉืื ื-.env:
FASTCOMMENTS_TENANT_ID=your-tenant-id
FASTCOMMENTS_API_KEY=your-api-key
ืื ืื ืื ืฉืืฉ. ืกืคืง ืืฉืืจืืช ืืืคืืกืืื ืืชืืืื ืืืืคื ืืืืืืื - ืืื ืฆืืจื ืืจืืฉืื ืืื ื. ืืชื ืืืื ืืคืจืกื ืืช ืงืืืฅ ืืืืืจืืช ืืืืฉื ืืชืืื ืืืฉืืช:
php artisan vendor:publish --tag=fastcomments-config
ืจืืืื Blade ืฉืืชืืืืื ืืืืกืคื
ืืืืืื ืืืืขื ืขื ืฉืืืฉื ืจืืืื Blade ืฉืืชื ืืืื ืืืฉืชืืฉ ืืื ืืฉืืจืืช ืืชืื ืืืช ืฉืื:
ืืืื'ื ืชืืืืืช:
<x-fastcomments url-id="my-page" />
ืืืื'ื ืฆ'ืื ืื:
<x-fastcomments-live-chat url-id="my-chat-room" />
ืกืคืืจืช ืชืืืืืช:
<x-fastcomments-comment-count url-id="my-page" />
ืื ืจืืื ืชืืื ืืคืจืืคืก ืืื url, locale, readonly, has-dark-background, ื-default-sort-direction. ืืกืงืจืืคืืื ื ืืขื ืื
ืืืืคื ืืกืื ืืจืื ื ืืืืืืืื, ืื ืฉืืชื ืืืื ืืืืื ืืืงื ืืกืคืจ ืืืืื'ืืื ืืืืชื ืขืืืื.
SSO ืืืืืืื
SSO ืืืื ืืืืืช ืืืคืขื ืขื ืฉื ื ืืฉืชื ื ืกืืืื:
FASTCOMMENTS_SSO_ENABLED=true
FASTCOMMENTS_SSO_MODE=secure
ืืจืืข ืฉืืื ืืืคืขื, ืจืืืื ืืชืืืื ืืืฆ'ืื ืืื ืงืืจืืื ืืืืืืืืช ืืช Auth::user() ืืืืจืืงืื ืืช ืืขืืืก ืืืืืื ืฉื SSO ืืชืื ืงืื ืคืืืืจืฆืืืช ืืืืืื'ื.
ืืฉืชืืฉืื ืืืืืจืื ืืืืืชืื ืืฆืืจื ืืืงื. ืืืจืืื ืจืืืื ืงืืฉืืจืื ืขืืืจ ืื ืืกื ืืืฆืืื ืืืืืืจืื ืืืจืืจืช ืืืื ืื ืชืืื ืlogin ื-logout ืฉื Laravel ืฉืื.
ืืฉื ื ืฉืชื ืืจืืื ืืฉืืื ืืืฆื ืืืื ืืืฉืชืืฉ ืฉืื ืืชืื ืื ืชืื ื ืืืฉืชืืฉ ืฉื FastComments:
ืืืคืื ืืืืกืก ืงืื ืคืืืืจืฆืื - ืืืืจ ืฉืืืช ืชืืื ืืช (ืืืื ื ืืืฆืื ื ืงืืืชืืช) ืื ืงืจืืืืช ืconfig/fastcomments.php:
'user_map' => [
'id' => 'id',
'email' => 'email',
'username' => 'name',
'avatar' => 'profile_photo_url',
],
ืืืคืื ืืืืกืก ืืืฉืง - ืืืฉื MapsToFastCommentsUser ืขื ืืืื ืืืฉืชืืฉ ืฉืื ืืฉืืืื ืืืื:
use FastComments\Laravel\SSO\Contracts\MapsToFastCommentsUser;
class User extends Authenticatable implements MapsToFastCommentsUser
{
public function toFastCommentsUserData(): array
{
return [
'id' => (string) $this->id,
'email' => $this->email,
'username' => $this->name,
'avatar' => $this->avatar_url,
'is_admin' => $this->hasRole('admin'),
];
}
}
ืื ืืฆื Secure SSO (ืืชืื ื-HMAC, ืืืืืฅ ืืืืฆืืจ) ืืื ืืฆื Simple SSO ื ืชืืืื.
ืืื ืืืจืฆืืืช API
ืืืืืื ืื ืขืืืคืช ืืช ื-API ืฉื FastComments ืขื ืคืืกืืื, ืืืจืงืช ืชืืืืืช, ืืืืจืงืช ืืงืื SDK ืืฉืืจื:
use FastComments\Laravel\Facades\FastComments;
// Admin API
$comments = FastComments::admin()->getComments(...);
// Public API
$counts = FastComments::publicApi()->getCommentCounts(...);
// SSO token for custom use
$token = FastComments::sso()->tokenFor($user);
ืืืฉืืืช ื ืชืื ืื ืฉื ืืืืืื ืืืืจืืคื
ืืงืืืืช ืืืฉืชืืฉืื ืืืืืจ ืืืืืื ืืืืจืืคื ืฉืื ื, ืืฉืชื ื ืกืืืื ืืืื ืืคืขืื ืืช ืื ืื ืงืืืืช ืืงืฆื - ืืืืื'ืืื, ืงืจืืืืช API, ื-SSO:
FASTCOMMENTS_REGION=eu
ืืกืืืื
ืื ื ืืงืืืื ืฉืืืืืื ืืื ืืงืื ืขืืื ืืืืกืืฃ FastComments ืืืคืืืงืฆืืืช Laravel ืฉืื. ืืื ืืืื ื ืขืืฉืื ื-Packagist ืืืืงืืจ ื ืืฆื ื-GitHub.
ืชืืืืขื ืื ื ืืืื ืื ืืฉ ืืื ืืฉืื!
ืืืืื!
