<?php
namespace App\Http\Controllers;
use App\HotelsProviders\Providers;
use App\Traits\ApiResponser;
use Illuminate\Http\Request;
class HotelsController extends Controller
{
use ApiResponser;
public function index(Request $request)
{
// call method and pass array as multiple arguments
$provider = new Providers();
$data = call_user_func_array([$provider, 'get'], $request->all());
return $this->successResponse($data);
}
public function search(Request $request)
{
// call method and pass array as multiple arguments
$provider = new Providers();
$data = call_user_func_array([$provider, 'search'], $request->all());
return $this->successResponse($data);
}
}
|