1. Go to this page and download the library: Download nutnet/laravel-comments 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/ */
use Nutnet\LaravelComments\Services\Commenter;
use Nutnet\LaravelComments\Facades\Commenter as CommenterFacade;
// ... some other code
public function comment(Commenter $commenter)
{
// variant 1
$commenter->comment($product, 'Test comment', $user, ['meta' => 'test']);
// variant 2, without meta
$user->comment($product, 'Test comment', $rate);
// variant 3
CommenterFacade::comment($product, 'Test comment', $user, ['meta' => 'test']);
}
use Nutnet\LaravelComments\Services\Commenter;
use Nutnet\LaravelComments\Facades\Commenter as CommenterFacade;
// ... some other code
public function comment(Commenter $commenter)
{
// variant 1
$commenter->commentAsGuest($product, 'Test comment', ['meta' => 'test']);
// variant 2, without meta
CommenterFacade::commentAsGuest($product, 'Test comment', ['meta' => 'test']);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.