Skip to content

Full Stack Programmer

Just another blog classic, isn't it!

Full Stack Programmer

Just another blog classic, isn't it!

  • Blog
  • Who am i?
  • More About Me
    • Skills
    • Experience
    • Recommendations
    • Education
    • My Activities
  • IT Services
  • Gaming
  • Contact
  • Privacy & Policy
Lumen

Lumen/Lumen: Create & Check Password

 Danyal  April 15, 2020  Posted in Laravel Tagged Authentication, hash, login, password

Laravel/Lumen comes with Hash facade that provides the secure Bcrypt & Argon2 hashing for storing user string passwords.

Default Laravel Login & Register Controllers uses Bcrypt for authentication.

Let’s take a look at the basic implementation:

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;

class UserController extends Controller
{
    /**
     * Update the password for the user.
     *
     * @param  Request  $request
     * @return Response
     */
    public function update(Request $request)
    {
        $request->user()->fill([
            'password' => Hash::make($request->newPassword)
        ])->save();
    }

    /**
     * Check stored password
     *
     * @param  Request  $request
     * @return Response
     */
    public function check(Request $request)
    {
      $user = User::where('email', '=', 'hello@email.com')->first();
      if ($user) {
          if (Hash::check($request->get('password'), $user->password) {
            // unauthenticated
            return ['error' => 'unauthenticated'];
          }
      }
      return [];
    }
}

Post Views: 6,892
Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.

Post navigation

Tip: How to install pip on mac OS →
← Laravel: Usage of old() in form when editing

View: LINKEDIN

Posts

  • Screen Size in React Native: Two Approaches November 5, 2025
  • Loading Custom Fonts in a React Native App (with Expo) November 2, 2025
  • Cascading Styles in React Native November 2, 2025
  • SafeAreaView Deprecation in React Native: What You Need to Know October 30, 2025
  • Behind the Scenes of JWTAuth::attempt() in Laravel September 28, 2025

Tags

array (3) Authentication (8) build (3) coding (8) commands (6) components (3) composer (4) database (5) devops (5) docker (3) drupal (5) Eloquent (3) error (5) Git (3) help (3) ios (5) javascript (19) jQuery (3) js (5) laravel (24) Laravel 5.6 (6) laravel5.7 (4) LaravelPassport (3) linux (7) lumen (7) LumenPassport (3) migration (4) mysql (8) network (3) node (3) php (27) python (6) security (4) solution (3) ssh (3) SSL (3) technology (8) tip of the day (3) tips (7) token (3) ubuntu (8) upgrade (3) vue.js (3) vuejs (13) vuex (3)

Advertisement

Advertisement

Categories

  • Apache2 (1)
  • Chrome (1)
  • CI/CD (1)
  • CkEditor (1)
  • Cloud (2)
  • CMS (8)
  • Code Editors (1)
  • Code snippets (1)
  • Composer (1)
  • Daily Tips (6)
  • Databases (5)
  • Development (5)
  • Docker (4)
  • Eloquent (1)
  • EU (1)
  • File System (1)
  • Git (3)
  • Google (2)
  • GraphQL (2)
  • Gulp (1)
  • Heandy Tips (2)
  • HTML (1)
  • javascript (22)
  • JWTAuth (1)
  • Laravel (33)
  • Laravel 5.5 (8)
  • Linux (10)
  • Lumen (6)
  • Microbit (4)
  • MySQL (5)
  • News & Updates (5)
  • Nginx (2)
  • Node (1)
  • Nuxt.js (3)
  • osMac (3)
  • Package Managers (1)
  • PHP (30)
  • Programming (9)
  • Python (3)
  • ReactNative (4)
  • Ruby on Rails (1)
  • Support (1)
  • Symfony (3)
  • Tips (7)
  • Tools (1)
  • Ubuntu (11)
  • Ubuntu 16.04 (10)
  • Ubuntu 17 (6)
  • Uncategorized (8)
  • Vlog (1)
  • Vuejs (11)
  • Wordpress (1)
  • xcode (3)

Recent Posts

  • Screen Size in React Native: Two Approaches
  • Loading Custom Fonts in a React Native App (with Expo)
  • Cascading Styles in React Native
  • SafeAreaView Deprecation in React Native: What You Need to Know

Tags

array (3) Authentication (8) build (3) coding (8) commands (6) components (3) composer (4) database (5) devops (5) docker (3) drupal (5) Eloquent (3) error (5) Git (3) help (3) ios (5) javascript (19) jQuery (3) js (5) laravel (24) Laravel 5.6 (6) laravel5.7 (4) LaravelPassport (3) linux (7) lumen (7) LumenPassport (3) migration (4) mysql (8) network (3) node (3) php (27) python (6) security (4) solution (3) ssh (3) SSL (3) technology (8) tip of the day (3) tips (7) token (3) ubuntu (8) upgrade (3) vue.js (3) vuejs (13) vuex (3)

RSS Rida.dk

  • The Berlin Wall
  • Turkey: one of top 10 most visited countries #6
  • Italy: one of top 10 most visited countries #5
  • Daily Motivation #3
  • Daily Motivation #2
  • Daily Motivation #1
  • China: one of top 10 most visited countries #4
  • USA: one of top 10 most visited countries #3
  • Spain: one of top 10 most visited countries #2
  • France: one of top 10 most visited countries #1

RSS Abdulraheem.dk

  • Facts about Lotte world tower
  • Facts About Ping An Finance Tower
  • Facts about Abraj Al-Bait
  • Facts about Shanghai tower
  • Facts about Merdeka 118
  • Facts about Brandenburg gate
  • Facts about the Berliner Fernsehturm
  • Top ten tallest buildings in the world
  • Facts about Lego House Billund
  • Facts about Universe science park

RSS Laravel News

  • Docker Support in Laravel VS Code Extension v1.4.2
  • Filament v5 Released With Livewire v4 Support and a New Blueprint Tool
  • Laravel Deadlock: Manage Technical Debt with Expiring Code Markers
  • Async Request Cancellation Updates in Inertia v2.3.10
  • FluentVox: AI Text-to-Speech for Laravel with Voice Cloning and GPU Acceleration

RSS Unknown Feed

RSS Abdulsamad.dk

  • Jake and the Panic Room
  • Brunlig lugtende morgenkaffe
  • DEn forvundene hund
  • Mysteriet i parken
  • Hvad er Burj Khalifa
  • Dødt liv
  • slæbende blod
  • Den udødlig væsen
  • Kælderen
  • Den arabiske spiderman

We runs on green energy!

This website is hosted Green - checked by thegreenwebfoundation.org

Copyright © 2026 Full Stack Programmer

Design by ThemesDNA.com

Verified by ExactMetrics