mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 10:41:32 +00:00
The official image from streamline does not currently work for the arm64 platform. As a temporary measure, the source code and docker build scripts have been lifted from the official images and are used to build locally. Some additional modifications are made to reduce overall image size, these are documented in docker/README.md
82 lines
2.5 KiB
PHP
Executable File
82 lines
2.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Streamline\Http\Controllers\Auth;
|
|
|
|
use Streamline\Models\User;
|
|
use Streamline\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Foundation\Auth\RegistersUsers;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class RegisterController extends Controller {
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Register Controller
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This controller handles the registration of new users as well as their
|
|
| validation and creation. By default this controller uses a trait to
|
|
| provide this functionality without requiring any additional code.
|
|
|
|
|
*/
|
|
|
|
use RegistersUsers;
|
|
|
|
/**
|
|
* Where to redirect users after registration.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $redirectTo = '/home';
|
|
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct() {
|
|
$this->middleware('guest');
|
|
}
|
|
|
|
/**
|
|
* Get a validator for an incoming registration request.
|
|
*
|
|
* @param array $data
|
|
* @return \Illuminate\Contracts\Validation\Validator
|
|
*/
|
|
protected function validator(array $data) {
|
|
return Validator::make($data, [
|
|
'first_name' => 'required|string|max:255',
|
|
'last_name' => 'required|string|max:255',
|
|
'username' => 'required|string|max:255|unique:users',
|
|
'pin' => 'required|min:5|max:5',
|
|
'position_id' => 'required|integer',
|
|
'password' => 'required|string|min:6|confirmed',
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Create a new user instance after a valid registration.
|
|
*
|
|
* @param array $data
|
|
* @return \Streamline\Models\User
|
|
*/
|
|
protected function create(array $data) {
|
|
return User::create([
|
|
'first_name' => $data['first_name'],
|
|
'last_name' => $data['last_name'],
|
|
'username' => $data['username'],
|
|
'registration_number' => $data['registration_number'],
|
|
'photo' => $data['photo'],
|
|
'position_id' => $data['position_id'],
|
|
'expiry_date' => $data['expiry_date'],
|
|
'email' => $data['email'],
|
|
'pin' => $data['pin'],
|
|
'phone' => $data['phone'],
|
|
'password' => $data['password'],
|
|
]);
|
|
}
|
|
|
|
|
|
}
|