PHP code example of alfonsobries / laravel-commentable
1. Go to this page and download the library: Download alfonsobries/laravel-commentable 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/ */
alfonsobries / laravel-commentable example snippets
namespace App\Models;
use Alfonsobries\LaravelCommentable\Contracts\CommentableInterface;
use Alfonsobries\LaravelCommentable\Traits\Commentable;
use Illuminate\Database\Eloquent\Model;
class BlogPost extends Model implements CommentableInterface
{
use Commentable;
// ...
}
namespace App\Models;
use Alfonsobries\LaravelCommentable\Contracts\CanCommentInterface;
use Alfonsobries\LaravelCommentable\Traits\CanComment;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements CanCommentInterface
{
use CanComment;
// ...
}