Package Data | |
---|---|
Maintainer Username: | lasserafn |
Maintainer Contact: | lasserafn@gmail.com (Lasse Rafn) |
Package Create Date: | 2016-12-19 |
Package Last Update: | 2017-09-07 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:12:40 |
Package Statistics | |
---|---|
Total Downloads: | 36 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Via Composer
$ composer require lasserafn/laravel-intempus
Add the follwing to your providers
array in config/app.php
:
\LasseRafn\LaravelIntempus\LaravelIntempusServiceProvider::class,
Run this in your terminal
php artisan vendor:publish --provider="LasseRafn\LaravelIntempus\LaravelIntempusServiceProvider" --tag="config"
Add this to your web.php file (or where-ever you desire)
Route::get('intempus/connect', function(\Illuminate\Http\Request $request) {
dd($request->all()); // Of cause, you can do whatever you need.
// Returned attributes are:
// pk
// hash
// token
});
$intempus = new Intempus();
$auth = $intempus->getAuth(); // returns url, hash and nonce in an array
return Redirect::to($auth['url']);
Remember to store the nonce, as you'll need it do send future requests.
In order to send a request, you'll need the nonce (returned from the getAuth() method) and the token that is returned from Intempus. Look at the "Route (for Auth)" section for help.
An example of this could be:
Route::get('intempus/start', function(\Illuminate\Http\Request $request) {
$intempus = new Intempus();
$auth = $intempus->getAuth(); // returns url, hash and nonce in an array
$request->session()->set('intempus_nonce', $auth['nonce']);
return Redirect::to($auth['url']);
});
Route::get('intempus/connect', function(\Illuminate\Http\Request $request) {
$nonce = $request->session()->get('intempus_nonce');
$token = $request->get('token');
$pk = $request->get('pk');
$intempus = new Intempus($nonce, $token, $pk);
dd( $intempus->products()->find(1) );
});
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email lasserafn@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
As of creating this package, I'm employeed at Bizz Zolutions - and one of my tasks was integrating Intempus timeregistrering with e-conomic regnskabsprogram. I believe in open sourcing as much as possible so this felt very natural. Had a talk with the boss and we're equally minded :-)
Use as you please. Oh, and sorry for the shameless backlinks.