Loading app/Models/User.php +17 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,23 @@ class User extends Model protected $primaryKey = 'US_ID'; /** * Check if a given password matches the stored password. * * @param string $password the password to try * @return bool true if the password matches, false otherwise */ public function checkPassword($password) { if($password == $this->US_PASSWORD) { return true; } else { return false; } } } ?> resources/views/test.blade.php +6 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,11 @@ <title>Document</title> </head> <body> {{$user->US_NAME}} @if ($user->checkPassword('securepassword')) <p>Match</p> @else <p>Unmatch</p> @endif </body> </html> Loading
app/Models/User.php +17 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,23 @@ class User extends Model protected $primaryKey = 'US_ID'; /** * Check if a given password matches the stored password. * * @param string $password the password to try * @return bool true if the password matches, false otherwise */ public function checkPassword($password) { if($password == $this->US_PASSWORD) { return true; } else { return false; } } } ?>
resources/views/test.blade.php +6 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,11 @@ <title>Document</title> </head> <body> {{$user->US_NAME}} @if ($user->checkPassword('securepassword')) <p>Match</p> @else <p>Unmatch</p> @endif </body> </html>