Add setting for taxrate and billingcharge

This commit is contained in:
weiweitoo
2018-07-20 18:47:19 +08:00
parent 4bb40e3643
commit 73c36dd8e3
14 changed files with 328 additions and 1 deletions
@@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\SettingTaxRate;
class SettingTaxRateController extends Controller
{
public function index()
{
$setting_tax = SettingTaxRate::latest()->first();
return response()->json($setting_tax, 201);
}
public function update(Request $request)
{
if($setting_tax = SettingTaxRate::latest()->first())
$setting_tax->update($request->all());
else
$setting_tax = SettingTaxRate::create($request->all());
return response()->json($setting_tax, 200);
}
}