<?php

namespace App\Http\Controllers\Api\V1\Admin;

use App\Http\Controllers\Controller;
use App\Http\Requests\StorePelimpahanRequest;
use App\Http\Requests\UpdatePelimpahanRequest;
use App\Pelimpahan;

class PelimpahanApiController extends Controller
{
    public function index()
    {
        $pelimpahans = Pelimpahan::all();

        return $pelimpahans;
    }

    public function store(StorePelimpahanRequest $request)
    {
        return Pelimpahan::create($request->all());
    }

    public function update(UpdatePelimpahanRequest $request, Pelimpahan $pelimpahan)
    {
        return $pelimpahan->update($request->all());
    }

    public function show(Pelimpahan $pelimpahan)
    {
        return $pelimpahan;
    }

    public function destroy(Pelimpahan $pelimpahan)
    {
        return $pelimpahan->delete();
    }
}
