add rebet api
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\TransaksiKeuntungan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TransaksiKeuntunganController extends Controller
|
||||
{
|
||||
public function getTransaksiKeuntunganByRujukan($norujukan){
|
||||
$transaksi = TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->get();
|
||||
|
||||
return response()->json($transaksi);
|
||||
}
|
||||
|
||||
public function createTransaksiKeuntungan(Request $request){
|
||||
$transaksi = TransaksiKeuntungan::on('mysql7')->create([
|
||||
'norujukan' => $request->norujukan,
|
||||
'bayaran_keuntungan' => $request->bayaran_keuntungan,
|
||||
'tarikh_bayaran'=> $request->tarikh_bayaran,
|
||||
'tempoh'=> $request->tempoh,
|
||||
'kodcaw'=> $request->kodcaw
|
||||
]);
|
||||
|
||||
return response()->json($transaksi,201);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Transaction extends Model
|
||||
{
|
||||
protected $table = 'transaksi_keuntungan';
|
||||
public $timestamps = false;
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'norujukan','bayaran_keuntungan','tarikh_bayaran','tempoh','kodcaw'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
}
|
||||
Reference in New Issue
Block a user