<?php

namespace App\Http\Controllers\Api\V1\Source;

use App\Api\Http\Resources\Sources\SourceCollection;
use App\Http\Controllers\Controller;
use App\LeadMallCounter;
use App\Source;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;

class SourceController extends Controller
{
    public function index(Request $request)
    {
        $sources = Source::where('status', 1)->get();
        return response()->json([
            'status' => true,
            'sources' => $sources,
        ]);
        // return $this->success(
        //     'source!',
        //     new SourceCollection($sources)
        // );
    }

    public function filterSource(Request $request): JsonResponse
    {
        $sources = Source::where('status', 1)->get();

        return response()->json([
            'status' => true,
            'sources' => $sources,
        ]);
        // return $this->success(
        //     'source!',
        //     new SourceCollection($sources)
        // );
    }
}
