Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Changing a users password

jkhsjdhjs edited this page Aug 11, 2018 · 2 revisions

In the following example we will change the password of the user admin to test123. Just follow the instructions below.

Switch to your w0bm root directory.

$ php artisan tinker
Psy Shell v0.7.2 (PHP 7.2.8 — cli) by Justin Hileman
>>> $user = \App\Models\User::whereUsername("admin")->first();
=> App\Models\User {#876
     id: 1,
     username: "admin",
     email: "[email protected]",
     activation_token: null,
     verified: 1,
     disabled: 0,
     deleted_at: null,
     created_at: "2017-03-08 00:19:11",
     updated_at: "2018-03-01 02:35:19",
     categories: "[1,2,3,4,5,6,7,8]",
     banreason: null,
     banend: null,
     icon_id: null,
   }
>>> $user->password = "test123";
=> "test123"
>>> $user->save();
=> true
>>> exit
Exit: Goodbye.
Clone this wiki locally