forked from s421507/eOSP2
Prześlij pliki do 'app/Http/Controllers'
This commit is contained in:
parent
4cd4553e61
commit
999d7aa317
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
use App\Rules\Pesel;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -53,7 +54,7 @@ class RegistrationController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
/* 'phoneNumber' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:9' */
|
||||||
class RegistrationController extends Controller
|
class RegistrationController extends Controller
|
||||||
{
|
{
|
||||||
public function create()
|
public function create()
|
||||||
@ -64,14 +65,24 @@ class RegistrationController extends Controller
|
|||||||
public function store()
|
public function store()
|
||||||
{
|
{
|
||||||
$this->validate(request(), [
|
$this->validate(request(), [
|
||||||
'name' => 'required',
|
'name' => 'required|alpha|min:3|max:45',
|
||||||
'surname' => 'required',
|
'surname' => 'required|alpha|min:3|max:45',
|
||||||
'email' => 'required|email',
|
'login' => 'required|alpha_num|min:3|max:45',
|
||||||
'password' => 'required',
|
'PESEL' => new Pesel,
|
||||||
'login' => 'required',
|
'phoneNumber' => 'required|digits:9',
|
||||||
'PESEL' => 'required',
|
'email' => 'required|email|unique:users',
|
||||||
'phoneNumber' => 'required'
|
'password' => 'required|confirmed|min:6',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'required' => ':attribute jest wymagany(e).',
|
||||||
|
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||||
|
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||||
|
'alpha' => ':attribute może zawierać tylko litery.',
|
||||||
|
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
|
||||||
|
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||||
|
'unique' =>':attribute jest już zajęty.',
|
||||||
|
'confirmed' =>':attribute się nie zgadza.',
|
||||||
|
'email' => 'Niepoprawny adres e-mail.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
@ -89,8 +100,10 @@ class RegistrationController extends Controller
|
|||||||
'number' => 'ABC123'
|
'number' => 'ABC123'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
auth()->login($user);
|
auth()->login($user);
|
||||||
|
|
||||||
return redirect()->to('/jednostka');
|
return redirect()->to('/jednostka');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user