Download the PHP package cleaniquecoders/inviteable without Composer
On this page you can find all versions of the php package cleaniquecoders/inviteable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cleaniquecoders/inviteable
More information about cleaniquecoders/inviteable
Files in cleaniquecoders/inviteable
Package inviteable
Short Description A polymorphic invitation system for Laravel. Any Eloquent model can have invitations.
License MIT
Homepage https://github.com/cleaniquecoders/inviteable
Informations about the package inviteable
About Your Package
Inviteable, inspired from Laravel Auth Invitations, but in this package, not for Auth, but for anything. Yes, we mean anything! Invitation to group, to class room, to meeting. Can be anything!
Installation
-
In order to install
cleaniquecoders/inviteablein your Laravel project, just run the composer require command from your terminal: -
Then in your
config/app.phpadd the following to the providers array: - Run the migration file:
Usage
Inviteable provide a trait \CleaniqueCoders\Inviteable\Traits\HasInviteable.
Following are the sample usage.
Setup
Creating Invitation
Once you have create the invitation, you may use the invitation with events and notifications.
Will add dispatching event on invitation created, so you can extend the use of the invitation to something else like notification.
More sample usage using routes/console.php:
Event and Listener
- On Invitation Created -
\CleaniqueCoders\Inviteable\Events\InvitationAccepted - On Invitation Accepted -
\CleaniqueCoders\Inviteable\Events\InvitationAlreadyAccepted - On Invitation Already Accepted -
\CleaniqueCoders\Inviteable\Events\InvitationCreated
Added Listener to send out e-mail invitation:
CleaniqueCoders\Inviteable\Listeners\Invitations- You need to configure in yourapp/Providers/EventServiceProviderto have this in your app.
Middleware
Added Middleware to be use to check only active invite able to get through
Configuration
Added config/inviteable.php to handle redirection - using route name:
Route
Default route php artisan route:list --name=invitation consist of
- Activation invitation - on success, you will redirect to
inviteable.redirect.accepted_tokenroute. You may overwrite this. In this route also handle already accepted invitation. Do specifyinviteable.redirect.already_accepted_tokenroute name to redirect to other page. - Access denied route - You can change the redirect by specify route name in
config.redirect.middleware
Views
Run php artisan vendor:publish --tag=inviteable to publish configuration and views for Inviteable.
Test
To run the test, type vendor/bin/phpunit in your terminal.
To have codes coverage, please ensure to install PHP XDebug then run the following command:
Contributions
Everyone are welcome to contribute to this package. However, it's a good practice to provide:
- The problem you solved
- Provide test
- Documentation
Without these 3, you may add extra work for the maintainer.
License
This package is open-sourced software licensed under the MIT license.
All versions of inviteable with dependencies
illuminate/support Version ^11.0 || ^12.0||^13.0
livewire/flux Version ^2.0
livewire/livewire Version ^4.0
spatie/laravel-package-tools Version ^1.16