Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muarachmann/laravel-invitations
Laravel Invitations
https://github.com/muarachmann/laravel-invitations
Last synced: about 1 month ago
JSON representation
Laravel Invitations
- Host: GitHub
- URL: https://github.com/muarachmann/laravel-invitations
- Owner: muarachmann
- License: other
- Created: 2022-02-01T14:23:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-28T03:15:48.000Z (over 2 years ago)
- Last Synced: 2024-04-20T08:02:07.612Z (9 months ago)
- Language: PHP
- Size: 30.3 KB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: contributing.md
- License: license.md
Awesome Lists containing this project
README
# Laravel Invitations
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Build Status][ico-travis]][link-travis]
[![CI](https://github.com/muarachmann/laravel-invitations/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/muarachmann/laravel-invitations/actions/workflows/run-tests.yml)This is where your description should go. Take a look at [contributing.md](contributing.md) to see a to do list.
## Installation
Via Composer
``` bash
$ 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
```php
'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:```bash
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](#configuring-the-package) with:
```bash
php artisan vendor:publish --provider="MuaRachmann\Invitations\InvitationServiceProvider" --tag="laravel-invitations-migrations"
```### Events
***Laravel Invitations*** comes with several events [events](https://laravel.com/docs/master/events) by default
* MuaRachmann\Invitations\Events\InvitationAccepted
* MuaRachmann\Invitations\Events\InvitationDeclined
* MuaRachmann\Invitations\Events\InvitationExpired
* MuaRachmann\Invitations\Events\InvitationSentThese 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`
```php
use MuaRachmann\Invitations\Events\InvitationAccepted;
use App\Listeners\SendWelcomeEmail;protected $listen = [
InvitationAccepted::class => [
SendWelcomeEmail::class,
],
];
```
`SendWelcomeEmail.php````php
public function handle($invitation)
{
// send welcome email to user
}
```## Change log
Please see the [changelog](changelog.md) for more information on what has changed recently.
## Testing
``` bash
$ composer test
```## Contributing
Please see [contributing.md](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
- [Mua Rachmann][link-author]
- [All Contributors][link-contributors]## License
MIT. Please see the [license file](license.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/muarachmann/laravel-invitations.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/muarachmann/laravel-invitations.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/muarachmann/laravel-invitations/master.svg?style=flat-square
[ico-styleci]: https://styleci.io/repos/12345678/shield[link-packagist]: https://packagist.org/packages/muarachmann/laravel-invitations
[link-downloads]: https://packagist.org/packages/muarachmann/laravel-invitations
[link-travis]: https://travis-ci.org/muarachmann/laravel-invitations
[link-styleci]: https://styleci.io/repos/12345678
[link-author]: https://github.com/muarachmann
[link-contributors]: ../../contributors