Download the PHP package benwilkins/yak without Composer

On this page you can find all versions of the php package benwilkins/yak. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yak

Yak for Laravel

A robust messaging system built for the Laravel framework. Create conversations between many users or one-on-one.

Built for Laravel 5.4 and up.

Installation

Start sending messages in just a few easy steps:

1. Add to Laravel via Composer

composer require benwilkins/yak

2. Register the Service Provider and Facade

In config/app.php, add the following:

3. Publish the config

php artisan vendor:publish

4. Run the migrations

php artisan migrate

5. Add the trait to your User model

Usage

Conversations

A conversation can exist between two or more participants. Participants can be added and removed easily through some methods that are included on the Conversation model.

Starting or finding a conversation

Yak includes a method to easily find or create a conversation between participants:

Adding/removing participants

You can easily add or remove participants from a conversation. If a conversation only has two participants, an exception will be thrown if you try to remove one of them.

Messages

Sending a message

Yak also includes a way to send a message to one or more users. This method will either find or create a conversation, and add the message to it automagically in one easy step.

Conversation States

A conversation state will determine if the conversation has unread messages for a given user. The conversation model will include a state_for_current_user attribute.

Participants (Users via Messageable trait)

By adding the Messageable trait to your User model, you can get all conversations and messages for a given user.

You can also get a "conversation list" for a user, which will return all unread conversations at the top of the list, followed by the next eight read conversations. You may override the number of read conversations to append to the the list.

Events

ConversationStarted

When using the Yak facade to start a conversation, a Benwilkins\Yak\Events\ConversationStarted event will be fired.

MessageSent

When a new message is created, a Benwilkins\Yak\Events\MessageSent event will be fired.

YakConversationParticipantAdded

When adding a participant(s) to a conversation via the addParticipants method on the Conversation model, a Benwilkins\Yak\Events\ConversationParticipantAdded event will be fired.

YakConversationParticipantRemoved

When removing a participant(s) to a conversation via the removeParticipants method on the Conversation model, a Benwilkins\Yak\Events\ConversationParticipantRemoved event will be fired.

Contracts

It is possible to extend all the models in the package, and even the Yak facade. To do so, simply create and register new service provider that binds the model contracts to the models you want to use.

Note: I highly recommend just extending the current models. There are boot methods and model events contained in there that are important to the application.

Example

And in config/app.php:


All versions of yak with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package benwilkins/yak contains the following files

Loading the files please wait ....