Skip to content

Commit e7f7da0

Browse files
committed
add apiToken Model
1 parent 6ccb534 commit e7f7da0

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

app/Models/ApiToken.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App\Models;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class ApiToken extends Model
8+
{
9+
protected $fillable = ['token'];
10+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('api_tokens', function (Blueprint $table) {
15+
$table->id();
16+
$table->string('token');
17+
$table->timestamps();
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*/
24+
public function down(): void
25+
{
26+
Schema::dropIfExists('api_tokens');
27+
}
28+
};

0 commit comments

Comments
 (0)