# Mutual Fund — Fund

**Controller:** `App\Http\Controllers\MfFundController`  
**Model:** `App\Models\MfFund`  
**Table:** `mf_funds`  
**Middleware:** `jwt.auth`, `check.token`, `dynamic.permission`

A fund is mapped to one AMC (`amc_id`), one category (`fund_category_id`), and one risk profile (`risk_profile_id`).

Assign these route names to the back-office role in route-API permissions before calling them.

---

## Mapping

| Field | References |
|-------|------------|
| `amc_id` | `mf_amcs.id` — use `mf-amc-dropdown` |
| `fund_category_id` | `mf_fund_categories.id` — use `mf-fund-category-dropdown` |
| `risk_profile_id` | `mf_risk_profiles.id` — use `mf-risk-profile-dropdown` |

Index/show also return nested `amc`, `fund_category`, and `risk_profile` objects.

## Required fields

| Column | Notes |
|--------|--------|
| `amc_id` | Required, must exist |
| `fund_category_id` | Required, must exist |
| `risk_profile_id` | Required, must exist |
| `fund_name` | Required |
| `slug` | Unique ticker/code (e.g. `EFUF`). Auto from `fund_name` if omitted |
| `is_transactional` | `1` Partner / `0` Display |
| `fund_start_date` | Required date |
| `status` | `A` / `I`, default `A` |

Optional fields follow `mf_funds` (NAV, AUM, trustee, portfolio URLs, min amounts, etc.).  
`create_by` / `update_by` come from `users_id`.

## Endpoints

| Action | Method | Path | Route name |
|--------|--------|------|------------|
| List | GET | `/api/mf-fund/mf-fund-index` | `mf-fund-index` |
| Show | GET | `/api/mf-fund/mf-fund-show/{id}` | `mf-fund-show/{id}` |
| Dropdown | GET | `/api/mf-fund/mf-fund-dropdown` | `mf-fund-dropdown` |
| Create | POST | `/api/mf-fund/mf-fund-store` | `mf-fund-store` |
| Update | POST | `/api/mf-fund/mf-fund-update/{id}` | `mf-fund-update/{id}` |
| Delete | DELETE | `/api/mf-fund/mf-fund-delete/{id}` | `mf-fund-delete/{id}` |

Update is **POST**, not PUT.

## Query params

**Index**

| Param | Description |
|-------|-------------|
| `per_page` | 1–100, default 10 |
| `amc_id` | Filter by AMC |
| `fund_category_id` | Filter by category |
| `risk_profile_id` | Filter by risk profile |
| `status` | `A` or `I` |
| `is_transactional` | `0` or `1` |
| `q` | Search `fund_name` or `slug` |

**Dropdown**

| Param | Default | Description |
|-------|---------|-------------|
| `status` | `A` | `A`, `I`, or `all` |
| `amc_id` / `fund_category_id` / `risk_profile_id` / `is_transactional` | — | Optional filters |

Dropdown returns `id`, `fund_name`, `slug`, `amc_id`, `fund_category_id`, `risk_profile_id`, `is_transactional`, `status`.

## Delete rule

Returns **409** if the fund has related settings, orders, SIP plans, NAV history, holdings, dividends, sector allocations, or exit-load rules. Soft-inactivate with `status = I` instead.

## Related docs

- cURL: `mf_fund_api_curl.md`
- Postman: `mf_fund.postman_collection.json`
