Download the PHP package ziming/laravel-myinfo-sg without Composer
On this page you can find all versions of the php package ziming/laravel-myinfo-sg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ziming/laravel-myinfo-sg
More information about ziming/laravel-myinfo-sg
Files in ziming/laravel-myinfo-sg
Package laravel-myinfo-sg
Short Description Laravel Package for Singapore MyInfo
License
Homepage https://github.com/ziming/laravel-myinfo-sg
Informations about the package laravel-myinfo-sg
Laravel MyInfo Singapore
A working PHP Laravel Package for MyInfo Singapore. With the annoying, time wasting hidden quirks of implementing it in PHP figured out.
Contributing
A donation is always welcomed (currently $0), especially if you or your employer makes money with the help of my packages. Which I am aware of a couple.
Is Myinfo v5 supported?
Yes. Although my employer say they won't stop me from releasing it, they are also not happy about it as it could help competitors.
So I am not going to provide documentation for now to make it a little harder to figure it out. But it should be easy enough for you to view the source code to figure out yourself.
Installation
You can install the package via composer:
Followed by adding the following variables to your .env
file.
The values provided below are the ones provided in the official MyInfo nodejs tutorial.
Change them to the values you are given for your app.
Lastly, publish the config file
You may also wish to publish the MyInfo official nodejs demo app ssl files as well to storage/myinfo-ssl. You should replace these in your production environment.
Usage and Customisations
When building your button to redirect to SingPass. It should link to route('myinfo.singpass')
After SingPass redirects back to your Callback URI, you should make a post request to route('myinfo.person')
If you prefer to not use the default routes provided you may set enable_default_myinfo_routes
to false
in
config/laravel-myinfo-sg.php
and map your own routes. This package controllers will still be accessible as shown
in the example below:
During the entire execution, some exceptions may be thrown. If you do not like the format of the json responses.
You can customise it by intercepting them in your laravel application app/Exceptions/Handler.php
An example is shown below:
The list of exceptions are as follows
Lastly, if you prefer to write your own controllers, you may make use of LaravelMyinfoSgFacade
or LaravelMyinfoSg
to generate the
authorisation api uri (The redirect to Singpass link) and to fetch MyInfo Person Data. Examples are shown below
You may also choose to subclass GetMyinfoPersonDataController
and override its preResponseHook()
template method to
do logging or other stuffs before returning the person data.
Changelog
Please see CHANGELOG for more information what has changed recently.
All versions of laravel-myinfo-sg with dependencies
ext-gmp Version *
ext-json Version *
ext-openssl Version *
archtechx/enums Version ^1.0
guzzlehttp/guzzle Version ^7.0
illuminate/contracts Version ^12.0
saloonphp/cache-plugin Version ^3.0
saloonphp/saloon Version ^3.0
spatie/laravel-package-tools Version ^1.16.6
web-token/jwt-framework Version ^4.0