app/Http/Controllers/ProfileCompanyController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $request->validate( [
            'pass_new'     => 'min:8|required',
            'pass_confirm' => 'min:8|same:pass_new'
        ], $this->messages() );
        $users = Session::get( 'auth' );
        $users = User::find( $users->id );
        if (Hash::check($request->get('pass'), $users->password)) {
            $users->password = Hash::make( $request->input( 'pass_new' ) );
            $users->update();
            $users->save();
            return redirect( '/profile' )->with( "ok", "Thay đổi password thành công" );
        }else
            return redirect( '/' )->with( "ok", "Mật khẩu không đúng" );
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'pass_new' => 'min:8|required' , 'pass_confirm' => 'min:8|same:pass_new' ] , $ this -> messages ( ) ) ; $ users = Session :: get ( 'auth' ) ; $ users = User :: find ( $ users -> id ) ; if ( Hash :: check ( $ request -> get ( 'pass' ) , $ users -> password ) ) { $ users -> password = Hash :: make ( $ request -> input ( 'pass_new' ) ) ; $ users -> update ( ) ; $ users -> save ( ) ; return redirect ( '/profile' ) -> with ( " ok " , " Thay đổi password thành công" ); } else return redirect ( '/' ) -> with ( " ok " , " Mật khẩu không đúng" ); }
Store a newly created resource in storage.
Store a newly created resource in storage .