PHP code example of webard / nova-comments

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

    

webard / nova-comments example snippets


use KirschbaumDevelopment\NovaComments\Commentable;

class Post extends Model
{
    use Commentable;

    // ...
}

namespace App\Nova;

use KirschbaumDevelopment\NovaComments\Commenter;

class Post extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            new Commenter(),

            // ...
        ];
    }
}

namespace App\Nova;

use KirschbaumDevelopment\NovaComments\Commenter;

class Post extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            new CommentsPanel(),

            // ...
        ];
    }
}

'available-for-navigation' => false

use KirschbaumDevelopment\NovaComments\Commenter as NovaCommenter;

class Commenter extends NovaCommenter
{
    /**
     * The number of resources to show per page via relationships.
     *
     * @var int
     */
    public static $perPageViaRelationship = 25;
}
bash
php artisan migrate
bash
php artisan vendor:publish