Files
exchange/app/Http/Controllers/SettingBillingChargeController.php
2018-09-12 15:36:49 +08:00

26 lines
698 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\SettingBillingCharge;
class SettingBillingChargeController extends Controller
{
public function index()
{
$billing_charge_setting = SettingBillingCharge::latest()->first();
return response()->json($billing_charge_setting, 201);
}
public function update(Request $request)
{
if($billing_charge_setting = SettingBillingCharge::latest()->first())
$billing_charge_setting->update($request->all());
else
$billing_charge_setting = SettingBillingCharge::create($request->all());
return response()->json($billing_charge_setting, 200);
}
}