show current rate api

This commit is contained in:
Nazri Hamzah
2018-06-30 16:13:26 +08:00
parent 79cad74ee0
commit 94b664bb45
4 changed files with 24 additions and 14 deletions
+7 -5
View File
@@ -12,11 +12,6 @@ class RateController extends Controller
return Rate::all();
}
public function show(Rate $rate)
{
return $rate;
}
public function store(Request $request)
{
$rate = Rate::create($request->all());
@@ -37,4 +32,11 @@ class RateController extends Controller
return response()->json(null, 204);
}
public function show()
{
$rate = DB::table('rates')->latest()->first();
return response()->json($rate, 200);
}
}