Completed
Pull Request — master (#23)
by ARCANEDEV
09:00
created

CreateAuthPasswordResetsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
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
class CreateAuthPasswordResetsTable extends Migration
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constructor
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * CreateAuthPasswordResetsTable constructor.
19
     */
20
    public function __construct()
21
    {
22
        parent::__construct();
23
24
        $this->setConnection(null)->setPrefix(null);
25
        $this->setTable(config('auth.passwords.users.table', 'password_resets'));
26
    }
27
28
    /* -----------------------------------------------------------------
29
     |  Main Methods
30
     | -----------------------------------------------------------------
31
     */
32
    /**
33
     * Run the migrations.
34
     */
35
    public function up()
36
    {
37
        $this->createSchema(function (Blueprint $table) {
38
            $table->string('email');
39
            $table->string('token');
40
            $table->timestamp('created_at')->nullable();
41
42
            $table->index(['email', 'token']);
43
        });
44
    }
45
}
46