Authentication: - Laravel Fortify + Sanctum with Inertia views - RBAC middleware (admin, project_owner, team_member, viewer) - Retro terminal-styled login/register/forgot-password pages Metro Map (core UI): - D3.js zoomable SVG canvas with metro line rendering - Station nodes with glow-on-hover, status coloring, tooltips - Breadcrumb navigation for multi-level drill-down - Node preview panel with zoom-in action - C64-style CLI bar with blinking cursor at bottom Backend services: - ProjectService (CRUD, phase transitions, park/stop, audit logging) - ThemaService (CRUD with audit) - MapDataService (strategy map L1, project map L2) - Thin controllers: MapController, ProjectController, ThemaController - 32 routes total (auth + app + API) Style foundation: - Retro-futurism theme: VT323, Press Start 2P, IBM Plex Mono fonts - Dark palette with cyan/orange/green/purple neon accents - Comprehensive seed data (4 themes, 12 projects, commitments, deps) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
90 lines
2.0 KiB
PHP
90 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\ProjectRol;
|
|
use Database\Factories\UserFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
|
|
class User extends Authenticatable
|
|
{
|
|
/** @use HasFactory<UserFactory> */
|
|
use HasApiTokens, HasFactory, Notifiable;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'email',
|
|
'password',
|
|
'functie',
|
|
'afdeling',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password',
|
|
'remember_token',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'email_verified_at' => 'datetime',
|
|
'password' => 'hashed',
|
|
];
|
|
}
|
|
|
|
// Relationships
|
|
|
|
public function roles(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(Role::class);
|
|
}
|
|
|
|
public function projects(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(Project::class)
|
|
->withPivot('rol')
|
|
->withTimestamps()
|
|
->using(ProjectUser::class);
|
|
}
|
|
|
|
public function eigenProjecten(): HasMany
|
|
{
|
|
return $this->hasMany(Project::class, 'eigenaar_id');
|
|
}
|
|
|
|
public function eigenSpeerpunten(): HasMany
|
|
{
|
|
return $this->hasMany(Speerpunt::class, 'eigenaar_id');
|
|
}
|
|
|
|
public function commitments(): HasMany
|
|
{
|
|
return $this->hasMany(Commitment::class, 'eigenaar_id');
|
|
}
|
|
|
|
public function acties(): HasMany
|
|
{
|
|
return $this->hasMany(Actie::class, 'eigenaar_id');
|
|
}
|
|
|
|
public function documents(): HasMany
|
|
{
|
|
return $this->hasMany(Document::class, 'auteur_id');
|
|
}
|
|
|
|
public function kennisArtikelen(): HasMany
|
|
{
|
|
return $this->hasMany(KennisArtikel::class, 'auteur_id');
|
|
}
|
|
|
|
public function auditLogs(): HasMany
|
|
{
|
|
return $this->hasMany(AuditLog::class);
|
|
}
|
|
}
|