<?php

namespace App\Http\Controllers\Api\V1;

use App\StageOfConstruction;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreStageOfConstructionsRequest;
use App\Http\Requests\Admin\UpdateStageOfConstructionsRequest;

class StageOfConstructionsController extends Controller
{
    public function index()
    {
        return StageOfConstruction::all();
    }

    public function show($id)
    {
        return StageOfConstruction::findOrFail($id);
    }

    public function update(UpdateStageOfConstructionsRequest $request, $id)
    {
        $stage_of_construction = StageOfConstruction::findOrFail($id);
        $stage_of_construction->update($request->all());
        

        return $stage_of_construction;
    }

    public function store(StoreStageOfConstructionsRequest $request)
    {
        $stage_of_construction = StageOfConstruction::create($request->all());
        

        return $stage_of_construction;
    }

    public function destroy($id)
    {
        $stage_of_construction = StageOfConstruction::findOrFail($id);
        $stage_of_construction->delete();
        return '';
    }
}
