<?php

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

use App\Http\Controllers\Controller;
use App\Http\Requests\StorePengakhiranRequest;
use App\Http\Requests\UpdatePengakhiranRequest;
use App\Pengakhiran;

class PengakhiranApiController extends Controller
{
    public function index()
    {
        $pengakhirans = Pengakhiran::all();

        return $pengakhirans;
    }

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

    public function update(UpdatePengakhiranRequest $request, Pengakhiran $pengakhiran)
    {
        return $pengakhiran->update($request->all());
    }

    public function show(Pengakhiran $pengakhiran)
    {
        return $pengakhiran;
    }

    public function destroy(Pengakhiran $pengakhiran)
    {
        return $pengakhiran->delete();
    }
}
