<?php

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

use App\Http\Controllers\Controller;
use App\Http\Requests\StorePenilaianakRequest;
use App\Http\Requests\UpdatePenilaianakRequest;
use App\Penilaianak;

class PenilaianakApiController extends Controller
{
    public function index()
    {
        $penilaianaks = Penilaianak::all();

        return $penilaianaks;
    }

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

    public function update(UpdatePenilaianakRequest $request, Penilaianak $penilaianak)
    {
        return $penilaianak->update($request->all());
    }

    public function show(Penilaianak $penilaianak)
    {
        return $penilaianak;
    }

    public function destroy(Penilaianak $penilaianak)
    {
        return $penilaianak->delete();
    }
}
