PHP code example of finagin / laravel-comment

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

    

finagin / laravel-comment example snippets


'providers' => [
    /*
     * Package Service Providers...
     */
    // ...
    Finagin\Comment\CommentServiceProvider::class,
    // ...
];
bash
php artisan vendor:publish --provider="Finagin\Comment\CommentServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Finagin\Comment\CommentServiceProvider" --tag="config"
 php
class Comment extends Finagin\Comment\Models\Comment
{
  ...
}
 php
class Post extends Model {
  use Commentable;

  protected $canBeRated = true;

  ...
}
 php
class Post extends Model {
  use Commentable;

  protected $mustBeApproved = true;

  ...
}