<?php

namespace App\Http\Controllers\API;

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

class TokensAPI extends Controller
{

 /*
  * Get tokens give  a contract ID
  *
  * */
    public function show ($contract_id)
    {
        // $token = Tokens::with('contract')->get();
        $token = Tokens::where('contract_id', $contract_id)->with('contract')->get();
        // Return the data as a JSON response
        return response()->json([
            'status' => 'success',
            'data' => $token,
        ], 200);
    }
}
