Skip to content

Major Enhancements

Choose a tag to compare

@nasrulhazim nasrulhazim released this 22 Apr 02:14
· 11 commits to master since this release
59428fe

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:

  1. On Invitation Created - \CleaniqueCoders\Inviteable\Events\InvitationAccepted
  2. On Invitation Accepted - \CleaniqueCoders\Inviteable\Events\InvitationAlreadyAccepted
  3. On Invitation Already Accepted - \CleaniqueCoders\Inviteable\Events\InvitationCreated

Added Listener to send out e-mail invitation:

  1. CleaniqueCoders\Inviteable\Listeners\Invitations - You need to configure in your app/Providers/EventServiceProvider to 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() to invitations() in HasInviteable.
  • 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