public function autoSave(Cache $cache, Request $request)
    {
        try {
            $hash = $this->auth_user->hash;
            $cache->put(
                "autoSavedPost-$hash",
                $request->all(),
                Carbon::now()->addHours(2)
            );
        } catch (BlogifyException $exception) {
            return response()->json([false, date('d-m-Y H:i:s')]);
        }

        return response()->json([true, date('d-m-Y H:i:s')]);
    }
public function autoSave(Cache $cache, Request $request)
    {
        try {
            $hash = $this->auth_user->hash;
            $cache->put(
                "autoSavedPost-$hash",
                $request->all(),
                Carbon::now()->addHours(2)
            );
        } catch (BlogifyException $exception) {
            return response()->json([false, date('d-m-Y H:i:s')]);
        }

        return response()->json([true, date('d-m-Y H:i:s')]);
    }
public function autoSave ( Cache $ cache , Request $ request ) { try { $ hash = $ this -> auth_user -> hash ; $ cache -> put ( "autoSavedPost-$hash" , $ request -> all ( ) , Carbon :: now ( ) -> addHours ( 2 ) ) ; } catch ( BlogifyException $ exception ) { return response ( ) -> json ( [ false , date ( 'd-m-Y H:i:s' ) ] ) ; } return response ( ) -> json ( [ true , date ( 'd-m-Y H:i:s' ) ] ) ; }
Save the current post in the cache

@param \Illuminate\Contracts\Cache\Repository $cache
@param \Illuminate\Http\Request $request;
@return \Symfony\Component\HttpFoundation\Response
Save the current post in the cache