Skip to content

sasin91/laravel-conversations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel 5 Conversations

Contents

For Laravel ~5

composer require sasin91/laravel-conversations

As with any package, it's a good idea to refresh composer autoloader.

composer dump-autoload

To publish conversable.php config file, run the following, vendor:publish command.

php artisan vendor:publish --provider="\Sasin91\LaravelConversations\ConversableServiceProvider"

You may configure the config file to your liking, however the defaults should work for most cases.

You can override the default models permanently in the published config file. Temporarily by setting the config value at runtime.

    config()->set('conversable.models.user', User::class);

additionally, as a convenience there are also config objects available, taking models as example:

    \Sasin91\LaravelConversations\Config\Models::swap('user', User::class);

You may rebind the concrete of the InvitationCode in your service provider.

    $this->app->singleton(\Sasin91\LaravelConversations\InvitationCode::class, Concrete::class);

as a convenience, the contract defines __invoke method to be defined, which means it's possible to use a \Closure for the implementation.

You may register global within scope of this package policy callbacks in your service provider,

\Sasin91\LaravelConversations\Config\Policies::before(function ($user, $ability) {
    // return boolean
});

\Sasin91\LaravelConversations\Config\Policies::after(function ($user, $ability) {
    // return boolean
});

And you are ready to go.

This package provides the Eloquent portion plus some policies of a Conversations implementation.

The common eloquent events are available as usual.

Additionally, when an invitation is accepted & declined the following events are dispatched.

		'accepted' => 'Sasin91\LaravelConversations\Events\InvitationAccepted',
		'declined' => 'Sasin91\LaravelConversations\Events\InvitationDeclined'

If you discover any vulnerabilities, please e-mail them to me at jonas.kerwin.hansen@gmail.com.

For issues, open a issue on Github.

I'm currently aware of issues with proxy-driver-commands and testing.

laravel-conversations is free software distributed under the terms of the MIT license.

About

Just a quick little conversations package built with Eloquent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages