itsmeabde / tiket-api
Laravel package for using api tiket.com
Requires
- php: ~5.6|~7.0
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is auto-updated.
Last update: 2025-04-16 03:06:40 UTC
README
Laravel Tiket Api's
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
Install
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
Usage
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.
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Bug
If you discover any bug related issues, please email itsmeabde@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.