61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
/**
|
|
* Model użytkownika - DATABASE-FIRST na istniejącej tabeli `sys_users`
|
|
* (baza operacyjna `softspm`). NIE zmieniamy schematu.
|
|
*
|
|
* Kolumny legacy (z func.php / index.php):
|
|
* USR_ID - PK
|
|
* USR_USERNAME - login
|
|
* USR_PASSWORD - hash hasła (legacy: MD5, docelowo bcrypt - patrz LoginController)
|
|
* USR_STATUS - '1' = aktywny
|
|
* USR_PRT_ID - uczestnik/system (sys_participants)
|
|
*/
|
|
class User extends Authenticatable implements AuthenticatableContract
|
|
{
|
|
use Notifiable;
|
|
|
|
protected $connection = 'softspm';
|
|
protected $table = 'sys_users';
|
|
protected $primaryKey = 'USR_ID';
|
|
|
|
/** Tabela legacy nie ma created_at/updated_at. */
|
|
public $timestamps = false;
|
|
|
|
/** Tabela legacy nie ma kolumny remember_token. */
|
|
protected $rememberTokenName = '';
|
|
|
|
protected $hidden = [
|
|
'USR_PASSWORD',
|
|
];
|
|
|
|
protected $guarded = [];
|
|
|
|
/**
|
|
* Laravel Auth: która kolumna trzyma hash hasła.
|
|
*/
|
|
public function getAuthPassword()
|
|
{
|
|
return $this->USR_PASSWORD;
|
|
}
|
|
|
|
/**
|
|
* Wyłączamy mechanizm "remember me" - brak kolumny w schemacie legacy.
|
|
*/
|
|
public function getRememberToken()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public function setRememberToken($value)
|
|
{
|
|
// no-op
|
|
}
|
|
}
|