PHP Classes

File: apps/MS-AvailableHotels/app/Http/Controllers/HotelsController.php

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Hotel Booking Available   apps/MS-AvailableHotels/app/Http/Controllers/HotelsController.php   Download  
File: apps/MS-AvailableHotels/app/Http/Controllers/HotelsController.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Hotel Booking Available
Search for hotels that are available for booking
Author: By
Last change:
Date: 2 years ago
Size: 757 bytes
 

Contents

Class file image Download
<?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);
    }
}