<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Year;
use Illuminate\Http\Request;

class YearsController extends Controller
{
    public function index(){
        $years = Year::all();

        return response()->json([
            'status'=>200,
            'data'=> $years ?? 'No years found',
        ],200);

    }
}
