1

I'm new to the laravel framework. I imported a github project and i'm trying to use it. I did the installations and migrations but I can't login, because I don't know where to find the admin email and password. I got this error enter image description here

  • That doesn't have anything to do with the admin credentials. It's saying that the route doesn't have a POST method. Check the route it's trying to access, and your routes file. – aynber Jul 09 '18 at 14:02
  • Route::get('/', 'UserController@index'); // route to process the form Route::post('login', array('uses' => 'UserController@doLogin')); post('logout', 'UserController@doLogout'); Route::get('logout', array('uses' => 'UserController@doLogout')); Route::get('home', 'AdminController@home'); – el hadji mamadou Thiam Jul 09 '18 at 14:10
  • where can i find the admin email? – el hadji mamadou Thiam Jul 09 '18 at 14:11
  • In the users table in the database, but you may need to reset the password. There are tutorials out there that can tell you how to do it. It's easiest using `artisan tinker`. Which route are you trying to access with your form? – aynber Jul 09 '18 at 14:18
  • of any users, i just downloaded the project from github , im running it with wamp – el hadji mamadou Thiam Jul 09 '18 at 14:40
  • They may not be loaded, then. Log into the database and do `SELECT * from users`. If there should be some loaded, then check with the project maintainers on how to find it. In any case, this error has nothing to do with the users and everything to do with the route. – aynber Jul 09 '18 at 14:47
  • I dit it , but It returns an empty result, is that norma? – el hadji mamadou Thiam Jul 09 '18 at 14:51
  • Yes. Laravel doesn't actually create any users for you, unless the project you downloaded does. You'll have to create them yourself. – aynber Jul 09 '18 at 14:53
  • I just inserted a new user but I still can't connect. Do I need to refresh the db? – el hadji mamadou Thiam Jul 09 '18 at 15:03
  • Nope. What error are you getting now? – aynber Jul 09 '18 at 15:03
  • "There was a problem logging you in. Please check your credentials and try again" – el hadji mamadou Thiam Jul 09 '18 at 15:06
  • You're going to have to troubleshoot that, then. I have no idea how you inserted the user, but the password field should be hashed and not have the plaintext password, or it won't match. See https://stackoverflow.com/questions/35753951/manually-register-a-user-in-laravel for how to do that. – aynber Jul 09 '18 at 15:08
  • the project is here : https://github.com/shirishmore/timesheet , can you try to run it locally and tell me if it works? – el hadji mamadou Thiam Jul 09 '18 at 15:08
  • Sorry, that goes well beyond what I can do right now. – aynber Jul 09 '18 at 15:11
  • it's all good, The adding with php artisan saved mee, Thanks a lot sir!! – el hadji mamadou Thiam Jul 09 '18 at 15:11

1 Answers1

0

Did you set up the right Route for Login? Maybe you're use HTTP Post Method on a GET Route. Look in your web.php if you're Routes are set correctly.

Maybe this one can help: [laravel throwing MethodNotAllowedHttpException

Lukas
  • 1,053
  • 8
  • 24