CreateAuthPasswordResetsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Arcanedev\LaravelAuth\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreatePasswordResetsTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 *
11
 * @see  \Arcanedev\LaravelAuth\Models\PasswordReset
12
 */
13
class CreateAuthPasswordResetsTable extends Migration
14
{
15
    /* -----------------------------------------------------------------
16
     |  Constructor
17
     | -----------------------------------------------------------------
18
     */
19
20
    /**
21
     * Make a migration instance.
22
     */
23
    public function __construct()
24
    {
25
        parent::__construct();
26
27
        $this->setConnection(null)->setPrefix(null);
28
        $this->setTable(config('auth.passwords.users.table', 'password_resets'));
29
    }
30
31
    /* -----------------------------------------------------------------
32
     |  Main Methods
33
     | -----------------------------------------------------------------
34
     */
35
36
    /**
37
     * Run the migrations.
38
     */
39
    public function up()
40
    {
41
        $this->createSchema(function (Blueprint $table) {
42
            $table->string('email');
43
            $table->string('token');
44
            $table->timestamp('created_at')->nullable();
45
46
            $table->index(['email', 'token']);
47
        });
48
    }
49
}
50