Skip to content

Latest commit

 

History

History
117 lines (79 loc) · 3.5 KB

readme.md

File metadata and controls

117 lines (79 loc) · 3.5 KB

Laravel Invitations

Latest Version on Packagist Total Downloads Build Status CI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require muarachmann/laravel-invitations

Usage

After installing the laravel Invite Codes package, register the service provider in your config/app.php file:

Optional in Laravel 5.5 or above

'providers' => [
    MuaRachmann\Invitations\InvitationServiceProvider::class,
    MuaRachmann\Invitations\InvitationEventServiceProvider::class,
];

Configuring the package

You can publish the config file with: This is the contents of the file that will be published at config/laravel-invitations.php:

php artisan vendor:publish --provider="MuaRachmann\Invitations\InvitationServiceProvider" --tag="laravel-invitations-config"

Run migrations required for this package. If you need to customize the tables, you can configure them with:

php artisan vendor:publish --provider="MuaRachmann\Invitations\InvitationServiceProvider" --tag="laravel-invitations-migrations"

Events

Laravel Invitations comes with several events events by default

  • MuaRachmann\Invitations\Events\InvitationAccepted
  • MuaRachmann\Invitations\Events\InvitationDeclined
  • MuaRachmann\Invitations\Events\InvitationExpired
  • MuaRachmann\Invitations\Events\InvitationSent

These events have the invitation model so you can listen to these events and take approriate actions e.g send welcome email.

include listener in EventServiceProvider.php

use MuaRachmann\Invitations\Events\InvitationAccepted;
use App\Listeners\SendWelcomeEmail;

protected $listen = [
    InvitationAccepted::class => [
        SendWelcomeEmail::class,
    ],
];

SendWelcomeEmail.php

public function handle($invitation)
{
    // send welcome email to user
}

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.