Package Data | |
---|---|
Maintainer Username: | itsmeabde |
Maintainer Contact: | itsmeabde@gmail.com (itsmeabde) |
Package Create Date: | 2016-08-30 |
Package Last Update: | 2018-04-06 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-09 15:17:12 |
Package Statistics | |
---|---|
Total Downloads: | 78 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 2 |
Total Forks: | 4 |
Total Open Issues: | 0 |
This package provides you to use tiket.com api with simple usage and it will let you focus on development of the api's user interface. See the DOCS for documentation
Via composer
$ composer require itsmeabde/tiket-api
Once this has finish, you will need to add the service provider to the providers
array in your app.php
config as follows:
itsmeabde/TiketApi/TiketApiServiceProvider::class
Finally, you will want to publish the config using the following command:
$ php artisan vendor:publish
Before usage, you mush configure api_key, user_agent, response
in tiket.php
config file. by default 'response' => 'json'
, do not change any uri if there is no available updated.
This package by default store token api in cookie with key token
. do not forget to configure your EncryptCookies.php
in App\Http\Middleware
folder.
protected $except = [
'token'
];
Example request search flight:
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;
}
}
Or you want create your own controller extends baseController
use Illuminate\Routing\Controller as BaseController;
use itsmeabde\TiketApi\TiketApi;
class BaseTiketController extends BaseController
{
public $tiket;
public function __construct()
{
$this->tiket = new TiketApi();
}
}
So you can call tiket object from class inheritance your own Controller without declare new object tiketApi for many times.
use Illuminate\Http\Request;
class FlightController extends BaseTiketController
{
public function searchFlight(Request $request)
{
$query = $request->all();
return $this->tiket->flightApi->searchFlight($query);
}
}
For more information, See DOCS.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any bug related issues, please email itsmeabde@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.