Add AuthToken model

This commit is contained in:
Daniel_I_Am 2020-08-29 13:59:46 +02:00
parent d0ca2ae497
commit fbe2831551
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84
2 changed files with 47 additions and 0 deletions

15
app/AuthToken.php Normal file
View File

@ -0,0 +1,15 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class AuthToken extends Model
{
public $timestamps = false;
protected $fillable = [
'name',
'token'
];
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAuthTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('auth_tokens', function (Blueprint $table) {
$table->id();
$table->string('name', 255);
$table->string('token', 255)->unique();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('auth_tokens');
}
}