Major Enhancements
The CleaniqueCoders\Inviteable\Traits\HasInviteable trait method has been rename from inviteable to invitations
/**
* Get all invitations.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function invitations()
{
return $this->morphMany(\CleaniqueCoders\Inviteable\Models\Invite::class, 'inviteable');
}Dispatch events on:
- 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.
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'CleaniqueCoders\Inviteable\Events\InvitationCreated' => [
'CleaniqueCoders\Inviteable\Listeners\Invitations\SendInvitationEmail',
],
];Added Middleware to be use to check only active invite able to get through
'inviteable => \CleaniqueCoders\Inviteable\Http\Middleware\Inviteable::class,Added config/inviteable.php to handle redirection - using route name:
<?php
return [
'redirect' => [
'accepted_token' => 'invitation.index',
'already_accepted_token' => 'invitation.index',
'middleware' => 'invitation.access_denied'
],
];Items below are the commits from git history.
- upgrade to 5.6
- Added InvitationCreated Event
- Rename
inviteable()toinvitations()inHasInviteable. - Added route
- Added error view
- Added invalid token exception
- Added Invitation Accepted and Invitation Already Accepted event
- Added Inviteable Controller
- Added relationship morphTo
- Load routes and views
- Added missing variable
- Added assertion on events and exception
- Added scope active, expired and accepted invitation
- Added inviteable config
- Load Inviteable config
- Added redirection on success activation
- Added access denied & invitation list route
- Added inviteable access denied page
- Added successful invitation page
- Added Inviteable middleware
- Fixed test
- Added Send Invitation Email Listener
- Added Send Invitation Mail
- Added send mail invitation view
- Added Mail Test
- Update dependencies
- added more example usage