added migration, model, and controller

This commit is contained in:
Zain Fauzan Rofie Azizi
2018-04-23 14:47:34 +08:00
parent 0a1f45d329
commit 4a8a075414
6 changed files with 95 additions and 1 deletions
@@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class DeliveryInfoController extends Controller
{
public function index()
{
return Product::all();
}
public function show(DeliveryInfo $deliveryinfo)
{
return $deliveryinfo;
}
public function store(DeliveryInfo $deliveryinfo)
{
$deliveryinfo = DeliveryInfot::create($request->all());
return response()->json(DeliveryInfo, 201);
}
public function delete(DeliveryInfo $deliveryinfo)
{
$deliveryinfo->delete();
return response()->json(null, 204);
}
}