Skip to content

Instantly share code, notes, and snippets.

@prio101
Created January 23, 2016 15:24
Show Gist options
  • Save prio101/613680a1f70ebb6550ea to your computer and use it in GitHub Desktop.
Save prio101/613680a1f70ebb6550ea to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers\Api\V1;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Psy\Util\Json;
use App\Model\BookingsModel;
class ApiController extends Controller
{
/**
* Display a listing of the Bookings data.
*
* @return Json
*
*/
public function bookingsApi(BookingsModel $bookings){
$allBookingsList = $bookings->allBookingsListing();
return response()->json($allBookingsList);
}
}
##########################################
#And Routes
#API Version 1.0
##########################################
Route::group(['prefix'=>'api/v1', 'namespace' => 'Api\V1' ] , function(){
Route::GET('/bookings' , 'ApiController@bookingsApi');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment