Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of stdClass given, called in C:\Users\60918958342\Desktop\Solus\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php on line 340 #409
Unanswered
RockNicolas
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Estou fazendo uam auth em laravel usando md5
`<?php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
//use Illuminate\Support\Facades\Log;
class LoginController extends Controller
{
public function showLoginForm()
{
return view('auth.login');
}
} `
`<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\DB;
class User extends Authenticatable
{
use Notifiable;
public static function findByUsername($username)
{
return DB::table('bd')
->whereRaw('upper(user) = ?', [strtoupper($username)])
->where('Ativo ou não', 'A')
->where('numero', '!=', 25236865)
->where('data de vencimento', '>=', date('Y/m/d'))
->first();
}
}
`
`<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Auth\LoginController;
Route::get('/', function() {
return view('auth.login');
})->name('login.form');
Route::get('/home', function () {
return view('home');
})->middleware('auth');
Route::get('login', [LoginController::class, 'showLoginForm'])->name('login.form');
Route::post('login', [LoginController::class, 'login'])->name('login');
Route::post('logout', [LoginController::class, 'logout'])->name('logout');`
alguem sabe me ajudar?
Beta Was this translation helpful? Give feedback.
All reactions