Registration module in development state
This commit is contained in:
0
Http/Controllers/.gitkeep
Normal file
0
Http/Controllers/.gitkeep
Normal file
35
Http/Controllers/RegisterController.php
Normal file
35
Http/Controllers/RegisterController.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Register\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
use Modules\Register\Http\Forms\RegistrationForm;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/**
|
||||
* Отображение формы регистрации
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$form = new RegistrationForm();
|
||||
|
||||
return view('register::form', [
|
||||
'form' => $form
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
43
Http/Forms/RegistrationForm.php
Normal file
43
Http/Forms/RegistrationForm.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Register\Http\Forms;
|
||||
|
||||
use Artmark\Forms\Form;
|
||||
|
||||
//use App\Models\User;
|
||||
|
||||
/**
|
||||
* Description of RegistrationForm
|
||||
*
|
||||
* @author Andrey Pokidov <pokidov@e-traffic.ru>
|
||||
*/
|
||||
class RegistrationForm extends Form
|
||||
{
|
||||
const MINIMAL_PASSWORD_LENGTH = 6;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->newEmail('email')->setId('email')
|
||||
->setLabelText(__('register::register.email_field'))
|
||||
->setRequired()
|
||||
->setMaxLength(255);
|
||||
|
||||
$this->newText('phone')->setId('phone')
|
||||
->setLabelText(__('register::register.phone_field'))
|
||||
->setMaxLength(25);
|
||||
|
||||
$this->newPassword('password')->setId('password')
|
||||
->setLabelText(__('register::register.password_field'))
|
||||
->setRequired()
|
||||
->setMaxLength(255);
|
||||
|
||||
$this->newPassword('password_confirm')->setId('password_confirm')
|
||||
->setLabelText(__('register::register.password_confirm_field'))
|
||||
->setRequired()
|
||||
->setMaxLength(255);
|
||||
|
||||
$this->newCheckbox('agree')->setId('agree')
|
||||
->setLabelText(__('register::register.agree'))
|
||||
->setRequired();
|
||||
}
|
||||
}
|
0
Http/Middleware/.gitkeep
Normal file
0
Http/Middleware/.gitkeep
Normal file
0
Http/Requests/.gitkeep
Normal file
0
Http/Requests/.gitkeep
Normal file
Reference in New Issue
Block a user