PHP code example of devdojo / chatter

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

    

devdojo / chatter example snippets


protected $listen = [
    'DevDojo\Chatter\Events\ChatterBeforeNewDiscussion' => [
        'App\Listeners\HandleNewDiscussion',
    ],
];

    public function handle(ChatterAfterNewDiscussion $event)
    {
        // $event->discussion
        // $event->post
    }

    public function handle(ChatterAfterNewResponse $event)
    {
        // $event->post
    }

    php artisan vendor:publish --provider="DevDojo\Chatter\ChatterServiceProvider"
    

    composer dump-autoload
    

    php artisan migrate
    

    php artisan db:seed --class=ChatterTableSeeder
    

php artisan vendor:publish --tag=chatter_assets --force
php artisan vendor:publish --tag=chatter_config --force
php artisan vendor:publish --tag=chatter_migrations --force

php artisan migrate

@if( Request::is( Config::get('chatter.routes.home')) )
    <title>Title for your forum homepage -  Website Name</title>
@elseif( Request::is( Config::get('chatter.routes.home') . '/' . Config::get('chatter.routes.category') . '/*' ) && isset( $discussion ) )
    <title>{{ $discussion->category->name }} - Website Name</title>
@elseif( Request::is( Config::get('chatter.routes.home') . '/*' ) && isset($discussion->title))
    <title>{{ $discussion->title }} - Website Name</title>
@endif

function chatter_before_new_discussion($request, $validator){}

function chatter_after_new_discussion($request){}

function chatter_before_new_response($request, $validator){}

function chatter_after_new_response($request){}