add api bank
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Bank extends Model
|
||||
{
|
||||
protected $table = 'bank';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $fillable = [
|
||||
|
||||
// ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Bank;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BankController extends Controller
|
||||
{
|
||||
public function showAllBank(){
|
||||
$bank = Bank::on('mysql7')->get();
|
||||
|
||||
return response()->json($bank);
|
||||
}
|
||||
}
|
||||
@@ -70,4 +70,6 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('negeri/{kodnegeri}',['uses'=>'NegeriController@showOneNegeri']);
|
||||
|
||||
$router->get('daerah/{koddaerah}',['uses'=>'DaerahController@showOneDaerah']);
|
||||
|
||||
$router->get('bank',['uses'=>'BankController@showAllBank']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user