1
0
forked from s421507/eOSP2

tworzenie jednostki - zapisywanie nazwy wybranej gminy/powiatu/woj. zamiast ID

This commit is contained in:
Krzysztof Strzelecki 2019-10-03 13:08:49 +02:00
parent e16ae83d64
commit 41ded8ef5d

View File

@ -51,12 +51,17 @@ class fireStationController extends Controller
$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([
'name' => $request -> unitName,
'number' => $request -> number,
'voivodeship' => $request -> voivodeship,
'county' => $request -> county,
'community' => $request -> community,
'voivodeship' => $voivodeship -> name,
'county' => $county -> name,
'community' => $community -> name,
'postOffice' => $request -> postOffice,
'zipCode' => $request -> zipCode,
'address' => $request -> address,