forked from s421507/eOSP2
tworzenie jednostki - zapisywanie nazwy wybranej gminy/powiatu/woj. zamiast ID
This commit is contained in:
parent
e16ae83d64
commit
41ded8ef5d
@ -51,12 +51,17 @@ class fireStationController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
$request = request();
|
$request = request();
|
||||||
|
|
||||||
|
$voivodeship = DB::table('wojewodztwa')->select('name')->where('id', $request -> voivodeship)->first();
|
||||||
|
$county = DB::table('powiaty')->select('name')->where('id', $request -> county)->first();
|
||||||
|
$community = DB::table('gminy')->select('name')->where('id', $request -> community)->first();
|
||||||
|
|
||||||
$jednostka = fireStation::create([
|
$jednostka = fireStation::create([
|
||||||
'name' => $request -> unitName,
|
'name' => $request -> unitName,
|
||||||
'number' => $request -> number,
|
'number' => $request -> number,
|
||||||
'voivodeship' => $request -> voivodeship,
|
'voivodeship' => $voivodeship -> name,
|
||||||
'county' => $request -> county,
|
'county' => $county -> name,
|
||||||
'community' => $request -> community,
|
'community' => $community -> name,
|
||||||
'postOffice' => $request -> postOffice,
|
'postOffice' => $request -> postOffice,
|
||||||
'zipCode' => $request -> zipCode,
|
'zipCode' => $request -> zipCode,
|
||||||
'address' => $request -> address,
|
'address' => $request -> address,
|
||||||
|
Loading…
Reference in New Issue
Block a user