1
0
forked from s421507/eOSP2

konflikt kontrolerów - fix

This commit is contained in:
Krzysztof Strzelecki 2019-09-30 19:19:32 +02:00
parent 033181f543
commit e94d670883
3 changed files with 6 additions and 3 deletions

View File

@ -7,11 +7,13 @@ use DB;
class DataController extends Controller class DataController extends Controller
{ {
/*
public function getVoivodeships() public function getVoivodeships()
{ {
$voivodeships = DB::table('wojewodztwa')->pluck("name","id"); $voivodeships = DB::table('wojewodztwa')->pluck("name","id");
return view('unit',compact('voivodeships')); return view('unit',compact('voivodeships'));
} }
*/
public function getCounties($id) public function getCounties($id)
{ {

View File

@ -5,7 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\fireStation; use App\fireStation;
use DB;
class fireStationController extends Controller class fireStationController extends Controller
{ {
@ -14,7 +14,9 @@ class fireStationController extends Controller
$fireStation = fireStation::find(auth()->user()->fireStationID); $fireStation = fireStation::find(auth()->user()->fireStationID);
return view('unit', ["fireStation" => $fireStation]); return view('unit', ["fireStation" => $fireStation]);
} else{ } else{
return view('unit'); $voivodeships = DB::table('wojewodztwa')->pluck("name","id");
return view('unit',compact('voivodeships'));
//return view('unit');
} }
} }
public function store() public function store()

View File

@ -51,7 +51,6 @@ Route::get('/strazacy', 'fireFightersController@create');
Route::get('/strazacy/add', 'fireFightersController@addForm'); Route::get('/strazacy/add', 'fireFightersController@addForm');
Route::post('/strazacy', 'fireFightersController@store'); Route::post('/strazacy', 'fireFightersController@store');
Route::get('/jednostka','DataController@getVoivodeships');
Route::get('/jednostka/getcounties/{id}','DataController@getCounties'); Route::get('/jednostka/getcounties/{id}','DataController@getCounties');
Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities'); Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities');