1. Go to this page and download the library: Download benwilkins/yak 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/ */
// Get all conversations for the user
$conversations = $user->conversations;
// Get all messages sent by the user
$messages = $user->messages;
// Get a count of unread messages
$unreadCount = $user->unreadMessageCount();
// Get all conversations containing unread messages
$unreadConversations = $user->unreadConversations();
namespace App\Providers;
// App\MyConversation will extend Benwilkins\Yak\Models\Conversation
// and implement Benwilkins\Yak\Contracts\Models\Conversation
use App\MyConversation;
use Benwilkins\Yak\Contracts\Models\Conversation as ConversationContract;
use Illuminate\Support\ServiceProvider;
class YakServiceProvider extends ServiceProvider {
public function register()
{
$this->app->bind(
ConversationContract::class,
MyConversation::class
);
}
}
'providers' => [
...
Benwilkins\Yak\YakServiceProvider::class,
App\Providers\YakServiceProvider::class, // Make sure this one comes after the one before it.
...
],
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.