forked from magonysandormate/PeePal
Felesleges változók kivéve
This commit is contained in:
@@ -9,7 +9,8 @@ class WcController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return response()->json(WcAdatok::all());
|
||||
$mosdok = WcAdatok::with('kerulet')->get();
|
||||
return response()->json($mosdok);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
|
||||
14
Backend/peepal_backend/app/Models/Keruletek.php
Normal file
14
Backend/peepal_backend/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';
|
||||
}
|
||||
@@ -9,7 +9,23 @@ class WcAdatok extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function kerulet(){
|
||||
return $this->belongsTo(Keruletek::class);
|
||||
}
|
||||
|
||||
protected $table = 'wc_adatok';
|
||||
|
||||
protected $fillable = ['nev', 'kerulet', 'kozeli_megall', 'akadalym', 'ar', 'nyitva', 'hossz_koord', 'szel_koord', 'utvonal'];
|
||||
protected $fillable = [
|
||||
'nev',
|
||||
'kerulet_id',
|
||||
'kozeli_megall',
|
||||
'akadalym',
|
||||
'ar',
|
||||
'nyitva',
|
||||
'hossz_koord',
|
||||
'szel_koord',
|
||||
'utvonal',
|
||||
'felhasznalo_id'
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user