i am deepak sharma.i am new to laravel 5.2. i am creating login,registration,and log out panel manually without auth function.
i have created a form in view
<form action='/login> <input type="text" name="username"><br/> <input type="password" name="password"><br/> <input type="submit" name="submit" value="login"> </form>it is taking me on login function on my controller but i do not know the further processing.i am not using {{form::open}} tags for opening a form.
please tell me further processing. i do not want to use auth function for login.how to proceed ?
thankyou in advance
Well your login function should take that user and pass to authenticate.
If your user and pass is in a database you must compare that to the form input and either pass it or fail it.
If it passes show a view and if not go back to the login page.
If you are not using the auth function. are you storing your passwords as clear text?
i do not know how to compare username and password of the textbox values. i know the concept of php but do not know how to apply that concept in laravel 5.2
http://www.tutelagesystems.com/blog/2015-12-30-building-your-own-laravel-authentication
Maybe that will help you?
If you are not going to use the auth function, then you are not using Laravel 5.2. Then you would do it as if doing procedural programming without the framework.
So you would go something like this if your users is not in a db:
$current_user = 'Mike';
$current_pass = 'Pass';
$user = $request->username; //This is from your form
$pass = $request->password;//This is from your form
If (($current_user == $user) && ($current_pass == $pass)) {
//Do something
}
above mentioned link did not work on laravel 5.2. can you paste coding for login in laravel 5.2
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community