PHP code example of tecnomanu / unilogin-laravel-lumen
1. Go to this page and download the library: Download tecnomanu/unilogin-laravel-lumen library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tecnomanu / unilogin-laravel-lumen example snippets
Route::get('/login-success', function (Request $request) {
// Receive from request "email";
// Your login logic here.
// ...
// Or use this example
$user = User::where('email', $request->email)->first();
Auth::login($user);
return redirect('/');
})->middleware('unilogin.success');
// SuccessTokenMiddleware.php //...
public function handle(Request $request, Closure $next) {
// ...
$credentials = $request->get('credentials');
// Merge additional fields to the request
$request->merge([
'email' => $credentials['email'],
'company_id' => $credentials['company_id']
// New field
]);
return $next($request);
}
//...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.