forked from magonysandormate/PeePal
Majdnem kész
This commit is contained in:
14
Backend/laravel9/app/Models/Keruletek.php
Normal file
14
Backend/laravel9/app/Models/Keruletek.php
Normal 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';
|
||||
}
|
||||
57
Backend/laravel9/app/Models/User.php
Normal file
57
Backend/laravel9/app/Models/User.php
Normal 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);
|
||||
}
|
||||
}
|
||||
36
Backend/laravel9/app/Models/WcAdatok.php
Normal file
36
Backend/laravel9/app/Models/WcAdatok.php
Normal 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'
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user