5 changed files with 71 additions and 25 deletions
-
16app/EncryptedPassword.php
-
5app/User.php
-
43app/widgets/Login/Login.php
-
3app/widgets/Presence/Presence.php
-
29database/migrations/20180324134149_create_encrypted_passwords_table.php
@ -0,0 +1,16 @@ |
|||
<?php |
|||
|
|||
namespace App; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class EncryptedPassword extends Model |
|||
{ |
|||
protected $fillable = ['id']; |
|||
public $incrementing = false; |
|||
|
|||
public function session() |
|||
{ |
|||
return $this->hasOne('App\Session'); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
<?php |
|||
|
|||
use Movim\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateEncryptedPasswordsTable extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->schema->create('encrypted_passwords', function(Blueprint $table) { |
|||
$table->string('user_id', 64); |
|||
$table->string('id', 64); |
|||
$table->text('data'); |
|||
$table->timestamps(); |
|||
|
|||
$table->primary(['user_id', 'id']); |
|||
|
|||
$table->foreign('user_id') |
|||
->references('id')->on('users') |
|||
->onDelete('cascade'); |
|||
}); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->schema->drop('encrypted_passwords'); |
|||
} |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue