Category : authentication

my problem is when I register a new user, after I submit the post request it throws an exception saying Add [name] to fillable property to allow mass assignment on [IlluminateFoundationAuthUser] and its already exist in fillable. namespace AppHttpControllersAuth; /*imports here*/ class SignupController extends Controller { public function store(Request $request) { $this->validate($request, [ ‘name’ => ..

Read more

We used the login provided by the laravel but changed it a little bit. Instead of using email to login/reset password we used username/name but unfortunately the reset password is no longer working. I tried to put dd inside of my credentials but it is not working ResetsPassword public function reset(Request $request) { $this->validate($request, $this->rules(), ..

Read more

I have made a laravel 7 basic system and copied into that all the parts from a working laravel 5.3 system. All works except for logging in. When I click Login it only blinks and the oauth_access_tokens och oauth_refresh_tokens are beeing generated in the database. The part of AuthenticateController and the row Route::get(‘authenticate/user’, ‘[email protected]’); in ..

Read more

i have my blade file like this: <div class="nav-item dropdown"> @if (Auth::check()) <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">{{ Auth::user()->name }}</a> <div class="dropdown-menu"> <a href="/profileDetail" class="dropdown-item">Profile</a> <a href="order_history" class="dropdown-item">My Order</a> <a href="#" class="dropdown-item" onclick="event.preventDefault(); document.getElementById(‘logout-form’).submit();"> Logout </a> <form id="logout-form" action="{{ route(‘logout’) }}" method="POST" class="d-none"> @csrf </form> </div> @else <div class="nav-item dropdown"> <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Login</a> <div ..

Read more

enter image description here When I’m logging with Facebook into my website then it through a server error. It doesn’t redirect me to the main website. What is the reason for that? I’ve checked all settings of the Facebook login for the developer. What is the possible reason for this server error(500)? Sourc..

Read more

I have this in my LoginController public function login() { $credentials = $this->validate(request(), [ ’email’ => ’email|required|string’, ‘password’ => ‘required|string’, ]); if (Auth::attempt($credentials)) { //auth attemptdevuelve verdadero o falso en caso de que las credenciales correspondan o no //Inician cambios RDAN $user = Auth::user(); if ($user->hasRole(‘admin’)) { return redirect(‘main’); } else if ($user->hasRole(‘externo’)) { return ..

Read more

I am trying to use the standard Laravel auth related functionality. I have the standard login, register, logout, etc… working fine. But my problem is that whenever I go to use functions like Auth::user() this is returning the GenericUser model rather than my own App/Models/User.php model. The problem is that my User’s model has some ..

Read more

The LoginController had this code before: class LoginController extends Controller { public function showLoginForm(){ $roles = Role::all(); return view(‘auth.login’, compact(‘roles’)); } public function logout(Request $request){ Auth::logout(); $request->session()->flush(); return redirect(‘/’); } public function login() { $credentials = $this->validate(request(),[ ’email’ => ’email|required|string’, ‘password’ => ‘required|string’, ]); if (Auth::attempt ($credentials)){//auth attemptdevuelve verdadero o falso en caso de que ..

Read more

I am having trouble restricting menu options for user roles in Laravel 7. The menu for ‘admin’ and ‘profesor’ are similar but I decided to make two different views for each one and make an @include in the main view. User model public function roles() { return $this->belongsToMany(Role::class,’assigned_roles’); } public function isAdmin(){ return $this->hasRoles([‘admin’]); } ..

Read more

Hello guys I have a login problem where my authentication work but after I redirect to homepage, it didnt show anything. this is my controller public function login(Request $request){ $user = [ ’email’ => $request->email, ‘password’ => $request->password, ]; if (Auth::Attempt($user)) { return redirect(‘home’); } return redirect()->back()->with(‘message’, ‘Wrong Credential!’); } this is my home blade ..

Read more

I am trying to store data by using id as primary key in Laravel 8, I used following code in controller : public function store(Request $request) { $job = new Job(); $job->employeer_id = Auth()->user(’employeer’)->id; $job->category = $request->category_name; $job->job_context = $request->job_context; $job->keywords = $request->keywords; $job->title = $request->title; $job->vacancy = $request->vacancy; $job->deadline = $request->deadline; $job->employment_type = $request->employment_type; ..

Read more

I have a blog where users can only comment after being logged in. The Problem After login, the page is redirected to the home page. blog_details.blade ”’ @if(!Auth::check()) <h3 class="news-details__title">Leave a reply</h3> <a class="thm-btn sidebar__tags-btn" href="{{route(‘login’)}}"> You must be logged in to post a comment.</a> @else <div id="app"> <div class="comment-one"> <h3 class="comment-one__title">Comments</h3> <div class="comment-one__single"> <div ..

Read more

I am connecting active directory with Laravel use adldap composer require adldap2/adldap2-laravel php artisan vendor:publish –provider="AdldapLaravelAdldapServiceProvider" i create credentials function in login controller $ldapResponse=$this->authldap->login($email,$password); in this line show Call to a member function login() on null Sourc..

Read more