Completed
Branch master (777640)
by Ashley
06:11
created
Category
migrations/2017_04_04_185723_create_invites_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('invites', function (Blueprint $table) {
16
+        Schema::create('invites', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('code')->unique();
19 19
             $table->string('for')->nullable();
Please login to merge, or discard this patch.
src/Generator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         return $this;
29 29
     }
30 30
 
31
-    public function for(string $email)
31
+    public function for (string $email)
32 32
     {
33 33
         $this->email = $email;
34 34
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function make()
64 64
     {
65
-        for($i = 0; $i < $this->amount; $i++) {
65
+        for ($i = 0; $i < $this->amount; $i++) {
66 66
             $this->build()->save();
67 67
         }
68 68
     }
Please login to merge, or discard this patch.
src/Models/Invite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 class Invite extends Model
8 8
 {
9
-    protected $dates = ['valid_until'];
9
+    protected $dates = [ 'valid_until' ];
10 10
 }
Please login to merge, or discard this patch.
src/Manager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@
 block discarded – undo
32 32
 
33 33
     protected function validateInvite(Invite $invite, $email = null)
34 34
     {
35
-        if($invite->max != 0 && $invite->uses >= $invite->max) {
35
+        if ($invite->max != 0 && $invite->uses >= $invite->max) {
36 36
             throw new MaxUsesReached;
37 37
         }
38 38
 
39
-        if(!is_null($invite->valid_until) && $invite->valid_until->isPast()) {
39
+        if (!is_null($invite->valid_until) && $invite->valid_until->isPast()) {
40 40
             throw new ExpiredInviteCode;
41 41
         }
42 42
 
43
-        if(!is_null($invite->for) && $invite->for != $email) {
43
+        if (!is_null($invite->for) && $invite->for != $email) {
44 44
             throw new NotYourInviteCode;
45 45
         }
46 46
     }
Please login to merge, or discard this patch.