forked from s421507/eOSP2
listy rozwijane poprawka
This commit is contained in:
parent
e6811a0e90
commit
8e95696e62
27
app/Http/Controllers/DataController.php
Normal file
27
app/Http/Controllers/DataController.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use DB;
|
||||
|
||||
class DataController extends Controller
|
||||
{
|
||||
public function getVoivodeships()
|
||||
{
|
||||
$voivodeships = DB::table('wojewodztwa')->pluck("name","id");
|
||||
return view('unit',compact('voivodeships'));
|
||||
}
|
||||
|
||||
public function getCounties($id)
|
||||
{
|
||||
$counties = DB::table("powiaty")->where("wojewodztwo_id",$id)->pluck("name","id");
|
||||
return json_encode($counties);
|
||||
}
|
||||
|
||||
public function getCommunities($id)
|
||||
{
|
||||
$communities= DB::table("gminy")->where("powiat_id",$id)->pluck("name","id");
|
||||
return json_encode($communities);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user