Majdnem kész

This commit is contained in:
Sándor Máté Magony
2025-04-24 15:38:31 +02:00
parent db245545eb
commit 2d71603962
121 changed files with 3870 additions and 2601 deletions

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Keruletek extends Model
{
public function wcAdatok(){
return $this->hasMany(WcAdatok::class);
}
protected $table = 'keruletek';
}

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Tymon\JWTAuth\Contracts\JWTSubject;
class User extends Authenticatable implements JWTSubject
{
use HasApiTokens, HasFactory, Notifiable;
public function getJWTIdentifier()
{
return $this->getKey();
}
public function getJWTCustomClaims()
{
return [];
}
// Change to match your migration
protected $table = 'felhasznalok';
protected $fillable = [
'nev',
'email',
'felh_nev',
'jelszo',
'is_admin',
];
protected $hidden = [
'jelszo',
'remember_token'
];
protected $casts = [
'is_admin' => 'boolean',
'email_verified_at' => 'datetime',
];
// This method tells Laravel to use jelszo field for passwords
public function getAuthPassword()
{
return $this->jelszo;
}
// Fix this to use 'jelszo' instead of 'password'
public function setJelszoAttribute($value)
{
$this->attributes['jelszo'] = \Illuminate\Support\Facades\Hash::make($value);
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class WcAdatok extends Model
{
use HasFactory;
public function kerulet(){
return $this->belongsTo(Keruletek::class);
}
public function felhasznalo(){
return $this->belongsTo(User::class);
}
protected $table = 'wc_adatok';
protected $fillable = [
'id',
'nev',
'kerulet_id',
'kozeli_megall',
'akadalym',
'ar',
'nyitva',
'hossz_koord',
'szel_koord',
'utvonal',
'felhasznalo_id'
];
}