change recent
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\HargaEmas;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class HargaEmasController extends Controller
|
||||
{
|
||||
public function showAllHargaEmas()
|
||||
@@ -29,6 +32,44 @@ class HargaEmasController extends Controller
|
||||
return response()->json($harga_emas, 200);
|
||||
}
|
||||
|
||||
public function updatehargaemas(Request $request)
|
||||
{
|
||||
$harini = Carbon::now();
|
||||
$harini = new Carbon;
|
||||
|
||||
$hargaemas=HargaEmas::on('mysql7')
|
||||
->where('recno','=',$request->recno)
|
||||
->update(array(
|
||||
'harga'=> $request->harga,
|
||||
'tarikhupdate' => $harini->toDateString()
|
||||
));
|
||||
|
||||
return response()->json($hargaemas, 200);
|
||||
}
|
||||
|
||||
public function createhargaemas(Request $request)
|
||||
{
|
||||
$harini = Carbon::now();
|
||||
$harini = new Carbon;
|
||||
|
||||
$hargaemas=HargaEmas::on('mysql7')
|
||||
->create([
|
||||
'karat' => $request->karat,
|
||||
'keterangan'=> $request->keterangan,
|
||||
'harga' => $request->harga,
|
||||
'harga2' => $request->harga2,
|
||||
'tarikhupdate' => $harini->toDateString()
|
||||
]);
|
||||
|
||||
return response()->json($hargaemas, 201);
|
||||
}
|
||||
|
||||
public function deletehargaemas($id)
|
||||
{
|
||||
$jemas = HargaEmas::on('mysql7')->where('recno','=',$id)->delete();
|
||||
|
||||
return response('Deleted Successfully', 200);
|
||||
}
|
||||
|
||||
|
||||
public function showAllHargaEmasMobile(){
|
||||
|
||||
Reference in New Issue
Block a user