well which is it, Laravel or Lumen?
Dec 2, 2016
6
Level 1
Lost trying to implement Authentication
Hi guys,
Complete noob to Laravel and Lumen here. I'm trying to create a simple username/password login system. I have read Laravel and Lumen documentation have been at it for like 6 hours now but I just can't figure it out. You have no idea how stupid I feel right now. Is Laravel better suited for this type of thing or something? Googling and searching on these boards got me nowhere either. I don't really understand the relationship between the AuthServiceProvider and this AuthManager class or how this all fits together.
Here is my LoginController.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class LoginController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
//
}
public function authenticate(Request $request) {
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
return ['result' => 'ok'];
}
}
public function LoginPage() {
return view("admin.login");
}
//
}
and this is where that gets me.
FatalThrowableError in AuthManager.php line 294:
Call to undefined method Illuminate\Auth\RequestGuard::attempt()
Please or to participate in this conversation.