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();
|
||||
|
||||
$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,
|
||||
|
Loading…
Reference in New Issue
Block a user