@@ -19,6 +19,6 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function validate($input) |
| 21 | 21 | { |
| 22 | - return password_verify($input,$this->password); |
|
| 22 | + return password_verify($input, $this->password); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function validate($input) |
| 14 | 14 | { |
| 15 | - return User::where('email',$input)->count() === 0; |
|
| 15 | + return User::where('email', $input)->count() === 0; |
|
| 16 | 16 | |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | protected $errors; |
| 14 | 14 | |
| 15 | - public function validate($request,array $rules) |
|
| 15 | + public function validate($request, array $rules) |
|
| 16 | 16 | { |
| 17 | 17 | foreach ($rules as $field => $rule) { |
| 18 | 18 | try { |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | public static $defaultTemplates = [ |
| 14 | - self::MODE_DEFAULT => [ |
|
| 15 | - self::STANDARD => '{{name}} does not macth', |
|
| 16 | - ], |
|
| 17 | - self::MODE_NEGATIVE => [ |
|
| 18 | - self::STANDARD => '{{name}} does not macth negative', |
|
| 19 | - ] |
|
| 20 | - ]; |
|
| 14 | + self::MODE_DEFAULT => [ |
|
| 15 | + self::STANDARD => '{{name}} does not macth', |
|
| 16 | + ], |
|
| 17 | + self::MODE_NEGATIVE => [ |
|
| 18 | + self::STANDARD => '{{name}} does not macth negative', |
|
| 19 | + ] |
|
| 20 | + ]; |
|
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | public static $defaultTemplates = [ |
| 14 | - self::MODE_DEFAULT => [ |
|
| 15 | - self::STANDARD => '{{name}} is already taken', |
|
| 16 | - ], |
|
| 17 | - self::MODE_NEGATIVE => [ |
|
| 18 | - self::STANDARD => '{{name}} is not already taken', |
|
| 19 | - ] |
|
| 20 | - ]; |
|
| 14 | + self::MODE_DEFAULT => [ |
|
| 15 | + self::STANDARD => '{{name}} is already taken', |
|
| 16 | + ], |
|
| 17 | + self::MODE_NEGATIVE => [ |
|
| 18 | + self::STANDARD => '{{name}} is not already taken', |
|
| 19 | + ] |
|
| 20 | + ]; |
|
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -3,23 +3,23 @@ |
||
| 3 | 3 | use App\Middleware\AuthMiddleware; |
| 4 | 4 | |
| 5 | 5 | |
| 6 | -$app->get('/','HomeController:index')->setName('home'); |
|
| 6 | +$app->get('/', 'HomeController:index')->setName('home'); |
|
| 7 | 7 | |
| 8 | -$app->group('',function () { |
|
| 9 | - $this->get('/auth/signup','AuthController:getSignUp')->setName('auth.signup'); |
|
| 10 | - $this->post('/auth/signup','AuthController:postSignUp'); |
|
| 8 | +$app->group('', function() { |
|
| 9 | + $this->get('/auth/signup', 'AuthController:getSignUp')->setName('auth.signup'); |
|
| 10 | + $this->post('/auth/signup', 'AuthController:postSignUp'); |
|
| 11 | 11 | |
| 12 | - $this->get('/auth/signin','AuthController:getSignIn')->setName('auth.signin'); |
|
| 13 | - $this->post('/auth/signin','AuthController:postSignIn'); |
|
| 12 | + $this->get('/auth/signin', 'AuthController:getSignIn')->setName('auth.signin'); |
|
| 13 | + $this->post('/auth/signin', 'AuthController:postSignIn'); |
|
| 14 | 14 | })->add(new GuestMiddleware($container)); |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -$app->group('',function () { |
|
| 19 | - $this->get('/auth/signout','AuthController:getSignOut')->setName('auth.signout'); |
|
| 18 | +$app->group('', function() { |
|
| 19 | + $this->get('/auth/signout', 'AuthController:getSignOut')->setName('auth.signout'); |
|
| 20 | 20 | |
| 21 | - $this->get('/auth/password/change','PasswordController:getChangePassword')->setName('auth.password.change'); |
|
| 22 | - $this->post('/auth/password/change','PasswordController:postChangePassword'); |
|
| 21 | + $this->get('/auth/password/change', 'PasswordController:getChangePassword')->setName('auth.password.change'); |
|
| 22 | + $this->post('/auth/password/change', 'PasswordController:postChangePassword'); |
|
| 23 | 23 | })->add(new AuthMiddleware($container)); |
| 24 | 24 | |
| 25 | 25 | |
@@ -18,15 +18,15 @@ |
||
| 18 | 18 | return isset($_SESSION['user']); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function attempt($email,$password) |
|
| 21 | + public function attempt($email, $password) |
|
| 22 | 22 | { |
| 23 | - $user = User::where('email',$email)->first(); |
|
| 23 | + $user = User::where('email', $email)->first(); |
|
| 24 | 24 | |
| 25 | 25 | if (!$user) { |
| 26 | 26 | return false; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if (password_verify($password,$user->password)) { |
|
| 29 | + if (password_verify($password, $user->password)) { |
|
| 30 | 30 | $_SESSION['user'] = $user->id; |
| 31 | 31 | return true; |
| 32 | 32 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | public function setPassword($password) |
| 28 | 28 | { |
| 29 | 29 | $this->update([ |
| 30 | - 'password' => password_hash($password,PASSWORD_DEFAULT) |
|
| 30 | + 'password' => password_hash($password, PASSWORD_DEFAULT) |
|
| 31 | 31 | ]); |
| 32 | 32 | } |
| 33 | 33 | |