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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-myinfo-sg

Laravel MyInfo Singapore

Latest Version on Packagist Total Downloads

A working PHP Laravel Package for MyInfo Singapore. With the annoying, time wasting hidden quirks of implementing it in PHP figured out.

Official MyInfo Docs

Will the new Myinfo be supported?

Yes, it is in my plans, previously I did not support Myinfo v4 as they announced that a new version will come out

Recently the new version is out in November 2024 and sites on Myinfo v3 are given 6 months to upgrade.

As usual, my other work & personal life commitments will come 1st but I will still try to get it out before Myinfo v3 expires

If anyone wants to make a PR before my own attempt, you are welcome to do so too

Hope that helps for those who emailed me.

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.

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.


All versions of laravel-myinfo-sg with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-gmp Version *
ext-json Version *
ext-openssl Version *
archtechx/enums Version ^1.0
guzzlehttp/guzzle Version ^7.0
illuminate/contracts Version ^11.0
spatie/laravel-package-tools Version ^1.16.6
web-token/jwt-framework Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ziming/laravel-myinfo-sg contains the following files

Loading the files please wait ....