<?php

namespace Clevercherry\Backslash4\Traits;

use Illuminate\Support\Facades\Storage;
use Illuminate\Http\Request;
use App\Models\Setting;

trait apiTraitv1
{
	/** 
	 * return an API response
	 * @param Request $request
	 * @param string $slug      a slug that represents part of the request/response
	 * 
	 * you WILL want to override this function in your own code
	 */
	public function apiV1(Request $request, $slug)
    {
		// $parts = explode('/', $slug);

		// $apiKey = Setting::getNetworkEventAPIKey();
		// $apiSecret = Setting::getNetworkEventAPISecret();

        // if(empty($apiKey) || empty($apiSecret))
        //     return response(['error' => 'API Key or Secret not set'], 403);

        // if(empty($slug))
        //     return response(['error' => 'API slug not set'], 403);
        
        return response(['error' => 'unknown'], 403);
    }

}
