Issue while trying to Login as admin laravel php

I am trying to setup my local debugging environment for laravel application.

Everything was working fine. Today I deleted my vendor folder and did composer install. First I started getting error payload is undefined.

After that I am not able to login in the application as admin. This was not happening earlier. I am not sure why this is throwing error.

username: [email protected] password: admin12345

in DB in hashed format: $2y$10$BgzkwksC4dl8i3IWBGBGLudU1BjvK1giWf7wZeQm7dSOoxkaXfIAG

Hash::check($request->password, $admin->password) is always returning false.

Here is my Code:

public function login(Request $request){ 
$validation = Validator::make($request->all(), [
'email' => 'required|email',
'password' => 'required|min:5',
]);
if ($validation->fails()) {
return redirect()->back()->withErrors($validation)->withInput($request->only('email', 'remember'));
}
$admin = Admin::Where('email',$request->email)->first();
if($admin){
if (Hash::check($request->password, $admin->password)) {
Auth::guard('admin')->attempt(['email' => $request->email, 'password' => $request->password], $request->remember);
Session::put('admin', $admin);
return redirect()->intended(route('admin.home'));
}else{
return redirect()->back()->withErrors(['Wrong password.'])->withInput($request->only('email', 'remember'));
}
}
return redirect()->back()->withInput($request->only('email', 'remember'));

}

/composer.json/

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"maatwebsite/excel": "~2.1.0",
"mobiledetect/mobiledetectlib": "^2.8",
"nesbot/carbon": "^1.22",
"pear/http_request2": "^2.3",
"wildbit/laravel-postmark-provider": "^3.0",
"wildbit/postmark-php": "^2.5",
"vanderlee/swaggergen": "^2.3.19"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2GGUDBz
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.