add api negeri poskod daerah
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Poskod;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PoskodController extends Controller
|
||||
{
|
||||
public function showAllPoskod(){
|
||||
$poskod = Poskod::on('mysql7')->get();
|
||||
|
||||
return response()->json($poskod);
|
||||
}
|
||||
|
||||
public function showOnePoskod($poskod)
|
||||
{
|
||||
$poskod = Poskod::on('mysql7')
|
||||
->where('poskod','=',$poskod)
|
||||
->first();
|
||||
return response()->json($poskod);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user