Integrate Mail, Nexmo and Slack notifications into Cachet

This commit is contained in:
James Brooks
2016-12-30 16:22:05 +00:00
parent 056b80a2bc
commit b8a9f41ae4
43 changed files with 1104 additions and 682 deletions

View File

@@ -12,9 +12,18 @@
namespace CachetHQ\Cachet\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
/**
* This is the invite class.
*
* @author Joseph Cohen <joe@alt-three.com>
* @author James Brooks <james@alt-three.com>
*/
class Invite extends Model
{
use Notifiable;
/**
* The attributes that should be casted to native types.
*
@@ -42,21 +51,11 @@ class Invite extends Model
self::creating(function ($invite) {
if (!$invite->code) {
$invite->code = self::generateInviteCode();
$invite->code = str_random(20);
}
});
}
/**
* Returns an invite code.
*
* @return string
*/
public static function generateInviteCode()
{
return str_random(20);
}
/**
* Determines if the invite was claimed.
*