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: 7,000
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

  • What Is Enumerable? April 1, 2026
  • 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

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 (20) 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)
  • javascript (23)
  • 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

  • What Is Enumerable?
  • Screen Size in React Native: Two Approaches
  • Loading Custom Fonts in a React Native App (with Expo)
  • Cascading Styles in React Native

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 (20) 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 Unknown Feed

RSS Unknown Feed

RSS Laravel News

  • Launch Your Dream SaaS Application with SaaSykit
  • Generate, Parse, and Convert Documents in PHP with Paperdoc
  • AI Generative Engine Optimization for Laravel
  • Spatie Shares Their Coding Guidelines as AI Skills
  • Attach PDFs Directly to Mailables in laravel-pdf 2.6.0

RSS Unknown Feed

RSS Abdulsamad.dk

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