<?php

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

use App\Http\Controllers\Controller;
use App\Http\Requests\StorePendampinganRequest;
use App\Http\Requests\UpdatePendampinganRequest;
use App\Pendampingan;

class PendampinganApiController extends Controller
{
    public function index()
    {
        $pendampingans = Pendampingan::all();

        return $pendampingans;
    }

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

    public function update(UpdatePendampinganRequest $request, Pendampingan $pendampingan)
    {
        return $pendampingan->update($request->all());
    }

    public function show(Pendampingan $pendampingan)
    {
        return $pendampingan;
    }

    public function destroy(Pendampingan $pendampingan)
    {
        return $pendampingan->delete();
    }
}
