PHP code example of carropublic / discussion

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

    

carropublic / discussion example snippets

bash
php artisan vendor:publish --provider="CarroPublic\Discussion\DiscussionServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="CarroPublic\Discussion\DiscussionServiceProvider" --tag="config"
 php
$post = Post::find(1);
$post->discussion('Hello World! This is a discussion');
 php
$user = User::find(1);
$post->discussAsUser($user, 'Hi! This is a simple discussion');
 php
$post->discussions