Probably overridden your custom auth controller? It will for sure if you edited the auth controller in the vendor/laravel files.
Aug 26, 2016
2
Level 1
Laravel 5.2.45 Login/Register (Auth) Problem
Hi,
I have now wasted a lot of my time to find out, but without any luck. I was developing my admin with Laravel 5.1 and upgraded to L5.2 by running command : composer update (ofcourse composer.json file edited ) php artisan --version => Laravel Framework version 5.2.45
now my login/register/reset (all auth methods) not working, it shows only the view, after submit the form, i get HTTP 500 internel Error
and there is nothing in log file. and log file is writable, because when i mistype any command in artisan, its added to the log.
AuthController.php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use App\Models\Role;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
// private $redirectTo = '/';
// private $maxLoginAttempts = 10;
/**
* Create a new authentication controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
protected function create(array $data)
{
return User::create([
'role_id' => '3',
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
}```
´´´
routes.php
```<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return view('home');
});
//Admin
Route::group([
'middleware' => ['auth', 'roles'],
'roles' => ['administrator', 'manager'],
'prefix' => 'admin',
'namespace' => 'Admin'], function () {
Route::get('/', function (){
return redirect('admin/dashboard/');
});
Route::get('dashboard', 'DashboardController@index');
//Translation
Route::resource('translation', 'TranslationController', ['only' => ['store', 'destroy']]);
//Words
Route::resource('word', 'WordController');
//Users
Route::resource('user', 'UserController');
//Ajax
Route::get('get-user-ajax/', 'UserController@getUsersAjax');
Route::get('get-word-ajax/', 'WordController@getWordsAjax');
Route::get('words-autocomplete/', 'TranslationController@getAutoCompleteWordsAjax');
Route::get('delete-sound/{sound?}', 'WordController@deleteSound');
//Route::get('remove-translation/', 'TranslationController@removeAjax');
//grammar
Route::resource('grammartype', 'GrammartypeController');
Route::resource('grammarproperty', 'GrammarpropertyController');
});
Route::Auth();
Please or to participate in this conversation.