<?php

namespace App\Http\Controllers;

use App\Models\Investor;
use Illuminate\Http\Request;

class InvestorController extends Controller
{
    public function store(Request $request)
{

    $investor = Investor::create($request->all());

    return $investor;

}
public function index()
    {
        return Investor::with('contracts')->get();
    }
    public function update(Request $request, $id)
    {
        $investor = Investor::findOrFail($id);
        $investor->update($request->all());
        return $investor;
    }
}
