wire postgres session repo, migrations, seed, and dev serve
This commit is contained in:
parent
02effe761a
commit
89b63cb9e9
8 changed files with 235 additions and 2 deletions
34
backend/database/SessionModel.php
Normal file
34
backend/database/SessionModel.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Database;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class SessionModel extends Model
|
||||
{
|
||||
protected $table = 'sessions';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $primaryKey = 'token';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
'token',
|
||||
'user_id',
|
||||
'expires_at',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'expires_at' => 'datetime',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(UserModel::class, 'user_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue