app/Console/Commands/AdminPassword.php
/**
     * Execute the console command.
     *
     * @return int
     */
Execute the console command.
@return int
Execute the console command . @return int
public function handle()
    {
       $result = User::query()->where('name','admin')
           ->update([
              'password'=>Hash::make(123456)
           ]);
       if($result) {
           $this->info("Success 密码重置成功!");
       }else{
           $this->error("Error 用户不存在");
       }
    }
public function handle ( ) { $ result = User :: query ( ) -> where ( 'name' , 'admin' ) -> update ( [ 'password' => Hash :: make ( 123456 ) ] ) ; if ( $ result ) { $ this -> info ( " Success 密码重置成功!"); } else { $ this -> error ( " Error 用户不存在"); } }
Execute the console command.
Execute the console command .