PHP code example of itsmeabde / tiket-api

1. Go to this page and download the library: Download itsmeabde/tiket-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itsmeabde / tiket-api example snippets

app.php
 php
itsmeabde/TiketApi/TiketApiServiceProvider::class
 bash
$ php artisan vendor:publish
tiket.php
EncryptCookies.php
 php
protected $except = [
    'token'
];
 php
use Illuminate\Http\Request;
use itsmeabde\TiketApi\TiketApi;

class FlightController extends Controller
{
    public function searchFlight(Request $request)
    {
        $query = $request->all();
        $tiket = new TiketApi();
        $response = $tiket->flightApi->searchFlight($query);
        
        return $response;
    }
}
 php
use Illuminate\Routing\Controller as BaseController;
use itsmeabde\TiketApi\TiketApi;

class BaseTiketController extends BaseController
{
    public $tiket;
    public function __construct()
    {
        $this->tiket = new TiketApi();
    }
}
 php
use Illuminate\Http\Request;

class FlightController extends BaseTiketController
{
    public function searchFlight(Request $request)
    {
        $query = $request->all();
        
        return $this->tiket->flightApi->searchFlight($query);
    }
}